Tip

Compiling PF's

Sometimes there is a need to compile physical files in bulk. There are two ways to do that, either create a file containing all source member names (member list) and write a CL to read that file, or make a user option, which works on one member at a time with validations, such as existence of the object, if it is in error then write the name of the member to a physical file. First of all, you create a user option, CP in this case as follows:

CALL PGM(*LIBL/CMPPF) PARM(&l &f &n). The program will create a physical file of all members, which are not compiled, and optionally copy those members to a specified source physical file, from where the option can be executed again.

 	
PGM     PARM(&SLIB &SRC &TLIB +
             &FILNAM &TSRC)    
DCL     &SLIB   *CHAR 10       
DCL     &TLIB   *CHAR 10       
DCL     &SRC    *CHAR 10       
DCL     &TSRC   *CHAR 10       
DCL     &FILNAM *CHAR 10       

CHKOBJ   *LIBL/&FILNAM  *FILE
MONMSG   CPF9801  EXEC(DO)   
/*The parameters of CRTPF can be changed as required */
CRTPF   &TLIB/&FILNAM  &SLIB/&SRC
MONMSG  CPF7302 EXEC(CPYSRCF + 
   FROMFILE(&SLIB/&SRC) +      
TOFILE(*LIBL/&TSRC) FROMMBR(&FILNAM))
ENDDO 
EXIT: ENDPGM 

This was first published in August 2001

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.