Source physical file in AS400

Introduction to Source physical file in AS400

Source physical file in AS400 CRTSRCPF,Source physical file,CRTSRCPF,create source physical file,Structure of the source physical file
Source physical file in AS400

Introduction

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.

Create command

CL command CRTSRCPF is used for creating a source physical file inside the library.

CRTSRSCPF, Create source physical file,Create source physical file in as400, Create source physical file in ibmi, source physical file in AS400, source physical file in ibmi
CRTSRCPF

FILE

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.

RCDLEN 

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. 

  1. Source sequence number 
  2. Date
  3. 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 

Warning!
QRPGSRC, QDDSSRC, QDDLSRC, QCLSRC, QCMDSRC, etc - record length of 92

Warning!
QRGLESRC - a record length of 112 (92 default + 20 bytes of comment)

Additional parameters

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.
CRTSRCPF, CRTSRCPF in AS400, CRTSRCPF in ibmi, create source physical file in AS400
CRTSRCPF
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

CRTSRCPF FILE(EASYCLASS1/TESTSRCPF)

CRTSRCPF,  create a source physical file without member in as400,ibmi, as400,iseries
CRTSRCPF

WRKMBRPDM

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.

WRKMBRPDM, Work with members using PDM in as400
WRKMBRPDM

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.
STRSEU, Start source entry utility in AS400
STRSEU


Related Post

Post a Comment

© AS400 and SQL Tricks. All rights reserved. Developed by Jago Desain