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

I want my simple Green screen should refersh every 1 min ,How can I do it..? Please share the logic

2 Answers  


How do I link an existing logical file to it's Physical File without recompiling?

2 Answers  


how to check on which PF , the LF is dependant ?

4 Answers   IBM,


what procedure should we use to find whether the following operations are successful or not setll setgt chain read reade readp pls tell with example i'm not lazy to read the manual or not lazy to do anything.but sometimes i cannot understand the things given in manual in high level english its little bit complicated for me,i can't understand their way of writing thats why i ask these questions here and find the solution in simple words that i can understand thats the real reason sir.sorry if i had hurt you or disturbed you.please understand my situation.

5 Answers   iGate,


1.I have a Batch job, Running for 4 hours, i want to reduce the executing time to 2 hours what should you do?

5 Answers   Cap Gemini,






how can an indexed file be used as arrival sequence in RPG?

3 Answers   IBM,


Why Rpg/400 is Famous?

2 Answers   IBM,


suppose if we want to update the data in cl what we will do?

9 Answers  


One of the job in subsystem is in Running status,expected time to complete this job is 2 minutes. But from last 5 -10 minutes this job is still in running status....What are the possible reasons...and What are the actions i need to perform to check this...?

4 Answers  


1.what are the ARITHMETIC EXPRESSIONS IN CL PGM? 2.How to PASSING PARAMETER TO CL PGM?

1 Answers   NetCracker,


Delete FileName at first statement in RPG.

1 Answers  


What is ment by record level identifier?

0 Answers  


Categories