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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

write an RPG program to calculate the marks of 5 students (A,B, C, D, E)in 3 different subjects (eng, math, sci) an display on the screen

1069


How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?

1759


How to handle duplicate error handling in RPG?

1982


How can we know running job is batch or interactive?

872


How to write record if no field or the field are different in physical file in rpgle ?

703


what is kids-rpg?

896


How to select highest score of each subject or how to select highest income of every month?

1508


is this a rpg channel?

904


which program rpg or cl is efficent to update a transaction onto a database file and why ?

990


are there any useful c runtime apis that I can call from rpg iv?

921


how do I declare a minor?

908


can you debug ile rpg program using isdb?

950


what is the use of sflnxtchg?

1032


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...?

1713


How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

780