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

924


how do I preserve and clean the array?

748


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

777


what is the rpg system?

767


how do you use commitment control in rpg?

850






What is ment by record level identifier?

746


what is the use of sflnxtchg?

894


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?

588


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

840


can I touch the array during treatments?

847


how do I declare a table or array in rpg iv?

822


Explain mdt?

764


What is the purpose of record level identifier?

803


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

785


what is program status data structure?

1559