program to find the number of objects used in a given
program through a display.

Answers were Sorted based on User's Feedback



program to find the number of objects used in a given program through a display. ..

Answer / divakar

Instead you can do DSPPGMREF to *OUTFILE and read that
outfile in RPGLE program where Copying spoolfile to flat
file and reading flat file based on positions may cause
confusion and may cause to get incorrect values.

Is This Answer Correct ?    5 Yes 0 No

program to find the number of objects used in a given program through a display. ..

Answer / harshad r suryawaunshi

The main thing in this program would be commanf DSPPGMREF

* Creat a display file to enter program name with length 10
* execute command either calling another CL program or
through QCMDEXC in the same RPG.
DSPPGMREF PGM(XXXXXXXX) OUTPUT(*PRINT) OBJTYPE(*PGM)
This command willl generate spool file named QPDSPPGM

* Copy this spool file in a flat file with CPYSPLF command.
Again you can do it through CL or in the same RPG with
QCMDEXC

CPYSPLF FILE(QPDSPPGM) TOFILE(XXXXXX) SPLNBR(*LAST)

* from line no. 16 objects used in the program start.
Object name can be found from position 55. Read the file in
which spool file is copied. set a condition

C read XXXXXX
C
C dow not %eof(XXXXXX)
C eval Heading=%subst(XXXXXX:5:6)
C if status='Object'
C eval Objectnm=%subst(XXXXXX:55:10)
C Dsply bBJECTNM
C read XXXXXX
C Enddo

Heading is program defineed variable with character and
length 6.

Is This Answer Correct ?    4 Yes 1 No

Post New Answer

More RPG400 Interview Questions

Need a sql query: retrive all duplicate records in table

3 Answers  


Can we trigger an rpg program which has user interaction with display file when updating a file using the command ADDPFTRG?

2 Answers  


what is the necessary keyword needed to scroll subfile records?

0 Answers   IBM,


What is a record lock error?

0 Answers   Wipro,


What will happen if we r using seton lr after return or vice versa.

5 Answers  






What is journalling and commitment control?

3 Answers   IBM,


What is significance of a file designated as a Primary file in Rpg400 program....also what's use of secoundry file

1 Answers  


how to retrieve particular field records from a physical file,say i have a physical file called 'employee' in it i have to retrieve the records of a field 'admin' present in pf 'employee' using rpg,but i should not use logical file or openquery file.

3 Answers   iGate, Wipro,


how to run only 10 modules of existing N modules in service program in RPGILE ?

3 Answers   Wipro,


Set on command is used for closed all opened files , initialize var and release resource , return cmd is used for return to calling program but my req. Is dnt close opened files and resource must released while doing transactions , how can i do this...?

0 Answers  


Need a sql query: retrieve all duplicate records in table?

1 Answers  


What is I90(Insure 90)?

1 Answers  


Categories