|Source physical file in AS400|
Source physical file is an object in AS400 which of course no doubt resides in a library. So, what does it actually contain?
It basically contains the different types of source members which contain the source code either in RPG, CL, COBOL, DDS, SQL, etc. Those source members are not an object until and unless they are not compiled.
CL command CRTSRCPF is used for creating a source physical file inside the library.
provide source physical file name in this parameter, some standard source file names are QRPGSRC(RPG source), QRPGLESRC(RPG ILE source), QDDSSRC (DDS source), QDDLSRC (SQL source), QCLSRC (CL source), QCMDSRC (Command source), etc, and the library where you want to create it.
provide the record length of the source physical file i.e. the number of bytes in the length of records stored in the source physical file. The record format of the source physical file contains three fields.
- Source sequence number
- Source statement
The default record length is 92 bytes. The source sequence number contains 6 bytes, Date 6 contains bytes and the source statement contains 80 bytes.
The interesting thing here is 6 bytes for the source sequence number and 6 bytes for the date are fixed formats means 12 bytes are fixed and the rest would be for the source statement and for your information the record length can be up to 32766 bytes. So the record length valid values range from 13 to 32766 bytes. Sizes for some of the standard source physical files are as follows.
Standard Record Lengths of SRCPF
QRPGSRC, QDDSSRC, QDDLSRC, QCLSRC, QCMDSRC, etc - record length of 92
QRGLESRC - a record length of 112 (92 default + 20 bytes of comment)
Once you took F10 on the CRTSRCPF command prompted through F4 will show additional parameters as follows where you see MAXMBRS parameter where you specify a maximum number of members that can be added to the source physical file.
Press F10 again will show you some more additional parameters.
In the above blog, we came to know the CRTSRCPF command which creates a source physical file in a library. So let's do some practical and create a source physical file on our own
Example: Create a source physical file
WRKMBRPDM command is used on the command line of AS400 to browse all the source members of a source physical file. Took F6 on WRKMBRPDM to add any new source member of any type to the source physical file.
Using the Source Entry Utility (SEU)
We can use SEU to start editing the source member and we use the CL command STRSEU from the command line to start SEU. This will create or open the source member TEST of type RPGLE in the source physical file provided in Edit mode.
Post a Comment