If there are 1000 member(PGM type) in a SRC file. How can we
compile in a CL program? ( It need to be done in a loop)?



If there are 1000 member(PGM type) in a SRC file. How can we compile in a CL program? ( It need to..

Answer / abhishek

Please follow steps given below -

Use DSPFD command to take member list of SRC source
physical file into a PF
DSPFD FILE(LIBRARY/SRC) TYPE(*MBRLIST) OUTPUT(*OUTFILE)
FILEATR(*PF) OUTFILE(LIBRARY/OUTFILE)

It will create an OUTFILE into specified LIBRARY having
MEMBER LIST (filed name MLNAME). Now use this OUTFILE into
CL program reading it into loop till EOF(CPF0864) and for
each record, compile program using CRTPGM command.

CRTPGM PGM(&MLNAME) ......etc.

I hope it will
work.

Is This Answer Correct ?    17 Yes 1 No

Post New Answer

More RPG400 Interview Questions

Write the subfile logic program for the given concept. Load the data to the subfile depends upon the designation where designation is not a key field?

2 Answers   TCS,


How to search particular records from the database file in rpg?

2 Answers  


what are the key words you must use when using a subfile?

0 Answers   IBM,


How would display prime numbers using CL program?

0 Answers   Hexaware,


Mr.Yallamanda Reddy P thanks for your answer sir,can we use test(D) opcode in RPG/400,if yes please help me by eloborating on that answer by writing a sample code for that sir

2 Answers   iGate,


1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?

0 Answers  


I have a Physical File name 'File1', which is present in two libraries named 'LIB1' & 'LIB2'. These 2 libraries are listed in the library list. Would like to access data from this file from these two libraries using RPG program. How to do this, any idea?

4 Answers  


what are the array operations?

1 Answers   IBM,


1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG? 4) How to find the attributes for subfiles? and what is the DDS for subfiles?

2 Answers   TCS,


wat is the difference between array and multiple occurence data structure?

4 Answers   Four soft,


1.Write code to read the records from a file and load an array of size 99? Make sure that you take care of all the error conditions?

2 Answers   HSBC,


How can we receive values from a called procedure in CL?

1 Answers   IBM, NTT Data,


Categories