Suppose i have 2 steps in my pgm. Step1- creates a file,
Step2 - generates report from file in step1, What changes
have to be made in Step2, so that if the file in Step1 is
empty Step2 should not be executed? No changes to be made to
Step1.

Answer Posted / reddy

After step1,before step2 , create another step , say stepA.

in step a , cheCk for the file in step1 is empty or not
using the IDCAMS utility

//STEP1 EXEC PGM=PG1
//DD1 DD DSN=TPAR.T01.A,DISP=(NEW,CATLG,DELETE),
DCB=(RECFM=FB,LRECL=80,BLKSIZE=800),
SPACE=(TRK,(5,5),RLSE),UNIT=PROD
//STEPA EXEC PGM=IDCAMS
//DD2 DD DSN=TPAR.T01.A,DISP=SHR
//SYNID DD *
PRINT INFILE(DD2) COUNT (1)
END
//IF (RC.STEPA = 4) THEN
//STEP2 EXEC PGM=REPORT
//DD3 DD DSN = XXX.XX.XX
//ELSE
//STEP3 EXEC PGM=PGM2
//ENDIF


if the file is empty , stepa will return 0 else it
reuns 4. If your file consists of the header and trailer
give count(3).

Is This Answer Correct ?    20 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What do you know about jcl?

650


what is “Cond= even” and “Cond=only”?

743


whats the diff bw the evaluate also and and?

1857


Name the statement which can be used to send data to another mvs jes3 node?

605


Explain how can the submitting users racf authority be overridden in a job stream?

672






How jcl is used for testing batch programs?

721


what are the statements that are not valid to be included in an include statement?

776


Explain how can the attributes of one sms dataset be copied to another dataset?

706


How to code these statements in JCL: CLEANUP INITIAL(NO) RESTART(NO) DYNALLOC(NO) job definition..?

1801


What is the purpose of disp parameter?

645


define cond parameter in jcl?

778


how can the same proc be re-used and called by many jobs?

912


1) SORT FIELDS=(20,4,CH,D,10,3,CH,D) OUTREC FIELDS=(7:20,4,C' FUTURE ',20,2,10,3,1Z,1,9,13,7, 24,57,TRAN=LTOU,6X'FF') This example illustrates how a fixed-length input data set can be sorted and reformatted for output. The SORTIN LRECL is 80 bytes. The reformatted output records are fixed length with a record size of 103 bytes. SOLRF (the IBM-supplied default) is in effect, so unless the SORTOUT LRECL is specified or available, it will automatically be set to the reformatted record length of 103. in the above example i have some doubts that a) sort fields=(20,4,CH,D,10,3,CH,D) -what exactly it does and this fields related to output record fields or input record fields b)outrec used to refprmat the records after sorting that means could please reply me as soon as possible Thanks. Venkat

7089


IIN APITUDE THEY GAVE ONLY 10 QUESTIONS.. THEY ARE SIMPLE ONE FROM NUMBER SERIES,BOATS,TIME & DISTANCE,PROFIT &LOSS,FIND OUT THE NUMBER ? 9 25 4 36 81 64 49 AND surveillance SPELLINGS E.T.C

1628


how you will the direct the data to spool using sysout option?

1765