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
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
How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?
How to handle duplicate error handling in RPG?
How can we know running job is batch or interactive?
How to write record if no field or the field are different in physical file in rpgle ?
what is kids-rpg?
How to select highest score of each subject or how to select highest income of every month?
is this a rpg channel?
which program rpg or cl is efficent to update a transaction onto a database file and why ?
are there any useful c runtime apis that I can call from rpg iv?
how do I declare a minor?
can you debug ile rpg program using isdb?
what is the use of sflnxtchg?
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...?
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