Q.How can more than two program be executed in batch mode
through SBMJOB in CL PGM but the condition is that program
must be executed one by one?Please wtite the senario?

2. IS it possibe more then two programs can be executed in
batch mode and HOw it will be executed in CL
program ,please write the senario?

Answers were Sorted based on User's Feedback



Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / syam

Yes, You can any number of program execute in batch it will
process one by one. (You see WRKACTJOB then press F5 in top
under Qbatch )

PGM PROGRAM1
SBMJOB CMD(CALL JOB1)
SBMJOB CMD(CALL JOB2)
SBMJOB CMD(CALL JOB3)
SBMJOB CMD(CALL JOB4)
ENDPGM

SBMJOB PROGRAM1 = This all jobs send to Qbatch to execute
one by one (This is on the Que.

Important:If you program screen(SDA) for input do not use
SBMJOB.

Is This Answer Correct ?    3 Yes 2 No

Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / amit

I think after SBMJOB of the first PGM you need to retrieve
jobd of it. When the Job is completed then SBMJOB next job.
If you submit jobs together they all are processing
simultaneously which is violation of requirements.

Your second question is not clear to me. But if it is in
continuation of the first question then yes, it is possible
to have more than two programs executed in batch mode and
you will have to continue doing RTVJOBD for submitted job
prior to submitting next job. The loop can be like-

SBMJOB (JOB1)

TAG1 : RTVJOBD (JOB1)

I am not sure which parameter is to be used but there is
one parameter that pertains to job status and If status is
complete GOTO TAG2 else got to TAG1 will give you the loop
required to implement our requirement.

TAG2 : SBMJOB (JOB2).....

you can add one as many jobs as required this way.

Is This Answer Correct ?    3 Yes 2 No

Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / megha

Above answers are correct,
But apart from that we can use
1. LDA (in first job , update data area with "1" , and
submit 2nd job if lda values ="1")
2. Data Queues for (pass the parameters) and when the first
job completed then use receivedata queue to submit 2nd job

Is This Answer Correct ?    1 Yes 0 No

Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / yogesh

PGM MYCLPGM

/*The CL variable must be a five-position decimal variable
with no decimal positions. */

DCL &STSVAR *DEC 5

SBMJOB CMD(CALL JOB1)

TAGJOB1: RTVJOBA RTNCDE(&STSVAR)

IF COND(&STSVAR *NE 0) THEN(GOTO CMDLBL(TAGJOB1))

SBMJOB CMD(CALL JOB2)
TAGJOB2: RTVJOBA RTNCDE(&STSVAR)

IF COND(&STSVAR *NE 0) THEN(GOTO CMDLBL(TAGJOB2))

ENDPGM

Is This Answer Correct ?    3 Yes 2 No

Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / sathya

This is can be acheived by using an API QUSRJOBI. it takes
five mandatory parameters. The status of the job will be
returned to variable &JOBENDR.

CALL PGM(QUSRJOBI) PARM(&JOBINFO &JOBINFL +
&JOBFMT1 &QJOBNAME &QINTJOB)
CHGVAR VAR(&JOBENDR) VALUE(%SST(&JOBINFO 348 1))
==

If the value returned is ''-->then its still running
If the value returned is '0'-->it has completed sucessfully
and then we can submit the next job
If the value returned is '1'-->It has ended in error.

Is This Answer Correct ?    1 Yes 0 No

Q.How can more than two program be executed in batch mode through SBMJOB in CL PGM but the conditi..

Answer / gagan

when we submit first job ,submit it by giving jon name .then using rtvjbsts we can find it out wheher job is active ,in jobq or in ouq.
if it is in OUTQ then we can sbmit the second job

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More IBM AS400 AllOther Interview Questions

Space & Skip Are Which Level Keywords?

0 Answers   IBM,


what are the different types of data areas?

1 Answers   IBM,


In 'o' Specs What Is The Opcode For Write?

0 Answers   IBM,


What is keyword PFILE specifies ?

1 Answers  


I want to run ls *.csv (sftp command) from CL Program... Can u plz tell me when SFTP command will start running? i.e.which command should I use in CL Program to run ls command?

2 Answers  






how can you check for a records existence without causing and i/o (chain/read)?

1 Answers   IBM,


How can we arrange duplicate records in a file?

0 Answers  


function of DSPPGMREF?

3 Answers  


what is the purpose of overrides?

1 Answers   IBM,


Hi.can any body give me the code for this quesiton please.Because i dont have to try to enter the code in to the AS/400 server.Please can anybody give the answer for this question with complete code? A smple RPLE pgm which accepts the starting number and ending number as parameter.It then has to count all the odd numbers b/w the accepted range of numbers and display the results/ Ex:if the input parameters are 11 and 30 the result should be 10(11,13,15,17,19,21,23,25,27,29) Please explain and give me the complete code?

2 Answers   Bally Technologies,


What is the purpose of "A CSRLOC (F1ROW F1COL)"?

1 Answers  


I am working in session1 ans session2. In session1 3 jobs are running. In session2 2 jobs are running. How many LDA and temporary files will be created?

3 Answers  


Categories