Difference between revisions of "Source file"

From MidrangeWiki
Jump to: navigation, search
m (Record length)
m (add References section with Template:reflist)
 
(8 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{AN}} is a type of [[physical file]] which contains additional fields to contain source code.  It is created with the [[CRTSRCPF]] command.
+
{{AN}} is a type of [[physical file]], with attribute of PF-SRC, which contains additional fields for source code.  It is created with the [[CRTSRCPF]] command.
  
==Record length==
+
==Default Record length==
 
*[[OPM]] source is 92 bytes
 
*[[OPM]] source is 92 bytes
 
**Sequence number field is 6 bytes
 
**Sequence number field is 6 bytes
Line 11: Line 11:
 
**Date field is 6 bytes
 
**Date field is 6 bytes
 
**Source statement field is 100 bytes
 
**Source statement field is 100 bytes
 +
 +
*QQMQRYSRC Query Management source is 91 bytes
 +
**Sequence number field is 6 bytes
 +
**Date field is 6 bytes
 +
**Source statement field is 79 bytes<ref>[http://www.mcpressonline.com/programming/sql/query-management-magic.html "Query Management Magic"] on October 31, 1994 at http://www.mcpressonline.com</ref>
  
 
==Hints & Tips==
 
==Hints & Tips==
QSYS/QADBXREF, the IBM-supplied system cross reference physical file, can be filtered to create a list of just source files.
+
*{{code|QSYS/QADBXREF}}, the IBM-supplied system cross reference physical file, can be filtered in a variety of ways to create a list of just source files.
*WRKQRY record selection
+
 
 +
*{{code|SYSTABLES}}, is located in library [[QSYS2]] or [[SYSIBM]], depending on OS/400 version, is an SQL view over the same physical file.
 +
 
 +
===WRKQRY record selection===
 
<pre>
 
<pre>
 
AND/OR  Field            Test  Value  
 
AND/OR  Field            Test  Value  
Line 21: Line 29:
 
</pre>
 
</pre>
  
 +
===Logical file===
 +
<pre>
 +
.....A..........T.Name++++++.Len++TDpB......Functions+++++++++++
 +
*************** Beginning of data ******************************
 +
    A          R SRCFMT                    PFILE(QSYS/QADBXREF)
 +
    A            DBXLIB                                       
 +
    A            DBXFIL                                       
 +
    A            DBXATR                                       
 +
    A            DBXTYP                                       
 +
    A            DBXTXT                                       
 +
    A* KEYS                                                   
 +
    A          K DBXLIB                                       
 +
    A          K DBXFIL                                       
 +
    A*
 +
    A* RECORD SELECTION                                       
 +
    A          S DBXATR                    CMP(EQ 'PF')       
 +
    A            DBXTYP                    CMP(EQ 'S')       
 +
****************** End of data *********************************
 +
</pre>
 +
 +
===SQL===
 +
<pre>
 +
SELECT DBXLIB Library
 +
, DBXFIL File
 +
, DBXOWN Owner
 +
, DBXTXT Desc
 +
, DBXATR Attrib
 +
, DBXTYP Type
 +
FROM QSYS.QADBXREF
 +
WHERE substr( DBXLIB,1,1 ) not in ( '#' , 'Q' )
 +
  AND DBXATR = 'PF'
 +
  AND DBXTYP = 'S'
 +
ORDER BY   DBXLIB
 +
, DBXFIL  ;
 +
</pre>
 +
<ref>Source: [http://www.mcpressonline.com/mc?128@@.6b50a14b posting by zreclay at 05:09am on August 15, 2007] on the www.mcpressonline.com message board</ref>
 +
 +
==References==
 +
{{reflist}}
 +
 +
==Categories==
 
{{stub}}
 
{{stub}}

Latest revision as of 15:01, 2 March 2010

Source file is a type of physical file, with attribute of PF-SRC, which contains additional fields for source code. It is created with the CRTSRCPF command.

Default Record length

  • OPM source is 92 bytes
    • Sequence number field is 6 bytes
    • Date field is 6 bytes
    • Source statement field is 80 bytes
  • ILE source is 112 bytes
    • Sequence number field is 6 bytes
    • Date field is 6 bytes
    • Source statement field is 100 bytes
  • QQMQRYSRC Query Management source is 91 bytes
    • Sequence number field is 6 bytes
    • Date field is 6 bytes
    • Source statement field is 79 bytes[1]

Hints & Tips

  • QSYS/QADBXREF, the IBM-supplied system cross reference physical file, can be filtered in a variety of ways to create a list of just source files.
  • SYSTABLES, is located in library QSYS2 or SYSIBM, depending on OS/400 version, is an SQL view over the same physical file.

WRKQRY record selection

AND/OR  Field             Test   Value 
        DBXATR            EQ     'PF'  
 AND    DBXTYP            EQ     'S'   

Logical file

.....A..........T.Name++++++.Len++TDpB......Functions+++++++++++
*************** Beginning of data ******************************
     A          R SRCFMT                    PFILE(QSYS/QADBXREF)
     A            DBXLIB                                        
     A            DBXFIL                                        
     A            DBXATR                                        
     A            DBXTYP                                        
     A            DBXTXT                                        
     A* KEYS                                                    
     A          K DBXLIB                                        
     A          K DBXFIL                                        
     A*
     A* RECORD SELECTION                                        
     A          S DBXATR                    CMP(EQ 'PF')        
     A            DBXTYP                    CMP(EQ 'S')         
****************** End of data *********************************

SQL

SELECT 	DBXLIB	Library
	, DBXFIL	File
	, DBXOWN	Owner
	, DBXTXT	Desc
	, DBXATR	Attrib
	, DBXTYP	Type
FROM	QSYS.QADBXREF
WHERE	substr( DBXLIB,1,1 ) not in ( '#' , 'Q' )
  AND	DBXATR = 'PF' 
  AND	DBXTYP = 'S'
ORDER BY 	  DBXLIB
	, DBXFIL  ;

[2]

References

  1. "Query Management Magic" on October 31, 1994 at http://www.mcpressonline.com
  2. Source: posting by zreclay at 05:09am on August 15, 2007 on the www.mcpressonline.com message board

Categories

This article is a stub. You can help by editing it.