Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


if i have three programs progA,progB and progC .now i call
progB from progA. but the progB does not exist . now i want
to call progC instead of starting dump. how can we achieve
this.

Answers were Sorted based on User's Feedback



if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / shantanu kumar dutta

Dear,

You can handle like that .check an object existance by
CHKOBJ like, If Object dose not exist than it through
MonMsg CPF9801,CPF9810 by this we can handle the
situations.

Eq->

CHKOBJ OBJ(&FLTLIBNM/PgmB) OBJTYPE(*PGM)
MONMSG MSGID(CPF9801 CPF9810) EXEC(GOTO CMDLBL(Call
PgmC))

Is This Answer Correct ?    20 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / sreedhar

We can use Monitor and ON-Error opcodes to do the same.

Is This Answer Correct ?    4 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / vinod babu

I m not sure about this answer. But my idea is dat we can
use ERROR HANDLING in main program. Suppose if the main pgm
does not exist then error routine will be handled and the
control passed to next statement after that routine.

Is This Answer Correct ?    3 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / raja

By Using *pssr we can handle the error and take dump of
that.

For Example:

call 'Nxtpgm'(if object is not Found it take
Nxt tag dump and call the nxtpgm1)
Call 'Nxtpgm1'


*pssr Begsr
Dump(A)
Goto Nxt
Endsr

seton lr

Is This Answer Correct ?    3 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / cagatay azkin

In ILE environment, when you call programB, define call with
(E) and set the indicators (position 73 and 74 I guess)

Later on, use some %built-in functions such as $error and
%status to check.

If there is an error, you can take an action in*PSSR error
subroutine or by checking the indicator in calc spec to
whatever you want.(in this case, you need to define it in INFSR)

For more detail, you can refer ibm's ile rpg reference book.

Is This Answer Correct ?    3 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / bhupendra tomar

just use 2 cmds
CHKOBJ and handle error through
MONMSG msg(CPF9801)

Is This Answer Correct ?    1 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / ali

in dump routine call actual pgm

Is This Answer Correct ?    1 Yes 1 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / raja

For Example:

call 'Nxtpgm'(if object is not Found it take
Nxt tag dump and call the nxtpgm1)
Call 'Nxtpgm1'

seton lr

*pssr Begsr
Dump(A)
Goto Nxt
Endsr

Is This Answer Correct ?    0 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / cage

why don't you check the HI indicator?

Is This Answer Correct ?    0 Yes 0 No

if i have three programs progA,progB and progC .now i call progB from progA. but the progB does no..

Answer / ali

only one option to use checkobj after call command

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More RPG400 Interview Questions

1.How to read a subfile in out put mode? 2.what are the keywords used to share same file? 3.using composite key which rpg code used?

3 Answers   HSBC,


Mr.Sidc sirfor my question{how to convert date format from one format to another i think in CL/400 its CVTDAT,Please tell in RPG/400 sir not in RPGILE} you have answered using MOVE opcode,can you illustrate me with a small example sir very kind of you.

1 Answers   CTS, IBM, iGate,


In a particular program one file is used where override command is applied to a file, now this program calls another program where we want to use the same file but without override.How it can be done?

6 Answers   Hexaware,


What is the diff bw PF/LF Name and their Record format name? what is restriction in record format then file name?

0 Answers   Wipro,


How do you find whether a record is locked or not?

2 Answers  






Why there is invention of RPG if we can do insert update delete in CL through SQL.Why the rise of RPG?

1 Answers   Infogain,


how to run only 10 modules of existing N modules in service program in RPGILE ?

3 Answers   Wipro,


what is use of sflnxtchg and use of MDT(modify data tag).both r same r not and can we use these on dspf and subfile.

2 Answers  


WHAT IS MONMSG IDENTIFIER FOR STRTCPFTP command IN cl (as/400)?

3 Answers  


if there is pf in two libraries and there is a logical file based on the PF, how to find the pf on which the pf is based.

2 Answers   TCS,


Q:HI friends accually ihave one problem plesase let me know the alternate code of this code. Related field description of code: Add a field, CALvsPRD, "Calendar Day Starts Before/After Production Day" to the parameter set WRKORDER which accepts values 'A' or 'B' o B = Calendar Day Starts Before Production Day o A = Calendar Day Starts After Production Day o Any other value indicates the production and calendar dates are always the same. code: Automatic Execution Of *INZSR Subroutine /Z01 * retrieves WRKORDER field values. /Z01 * Calculate default Production Date and return it to caller. /Z01 * Production date defaults to system date /Z01 C Eval P@Pdate = %DATE() /Z01 * unless Calendar date starts Before PDN(production) date and /Z01 * system time is before PDN Start Time then /Z01 * PDN date is yesterday. /Z01 C If W@CALvsPRD = 'B' and /Z01 C %TIME() < %TIME (W@Strtime) /Z01 C Eval P@Pdate -= %Day(1) /Z01 * unless Calendar date starts After PDN date and /Z01 * system time is *GE PDN(production) Start Time then /Z01 * PDN date is tomorrow. /Z01 C ElseIf W@CALvsPRD = 'A' and W@Strtime > *Zero and /Z01 C %TIME() >= %TIME (W@STrtime) /Z01 C Eval P@Pdate += %Day(1) /Z01 C EndIf /Z01 C Eval *InLr = *On

0 Answers   IBM,


I have learnt through Net that Debugging a Batch job involves 1. Submit the job with the HOLD (*YES) parameter: SBMJOB HOLD(*YES) or Hold the job queue that before submitting the job by using the HLDJOBQ command. 2. Determine the job name, user, and number of the submitted job by using the WRKSBMJOB command. 3. Type the Start Service Job command on your screen: STRSRVJOB JOB(job name/user/number) 4. Type the Start Debug command on your screen: STRDBG 5. Release the job in the jobq. Type WRKSBMJOB and then put a 6 beside the job to be released and press enter, or, if the job queue was put on hold, release the job queue with the RLSJOBQ command. 6. A display appears when the job is ready to start, saying that you can now begin debugging the job. Press F10 to show the Command Entry display. 7. Now you can start debugging by entering an Add Break Point command: ADDBKP 8.ENDDBG 9.ENDSRVJOB I tried this for RPG/400 Program and up to six steps of the above it's ok,but for me no source is displayed and i typed DSPMODSRC in Command line but still i can't see the sourceif i press F.10 and enter command ADDBKP i don't know how to add break points through it,usually i add break points using F.6 for Interactive job debugs,but since this is batch i don't know sir,Please help me out. I was asked this question in a interview,i know only RPG/400 and i’m asking for debugging of RPG/400 program only sir. or is it only possible to debug BATCH RPG ILE JOB and it is not possible to debug BATCH RPG/400 JOB kindly help me out sir

4 Answers   HSBC,


Categories