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

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

682


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

1283


How Chain operation copies the record's data to the input buffer for the program?

1070


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

824


Interviewer asked me write down DDS for load all subfile .can anybody write dds

1009






What is ment by record level identifier?

645


can you debug ile rpg program using isdb?

730


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

473


If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?

608


how does the rpg element work?

711


1.Load an runtime array of length 99 from the pf and you want to handle all the possible errors?

2360


what happens when sflsiz = sflpag? What are the advantages and disadvantages?

704


How to call one program from another program in RPG? please help me with the code

1250


do you use message subfiles? What are the necessary keywords required coding a message subfile?

679


what is program status data structure?

1366