In one of intervie, my interviwer asked, I have a file
which contains 4 records I would like to split the 4
different outputs for each record how to do?
Answers were Sorted based on User's Feedback
Answer / sachin
above answer is partially correct
use below syntax i have already performed this code
in our application.
//S1 EXEC PGM=SORT
//SORTIN DD DSN=INPUT FILE,DISP=SHR
//DD01 DD DSN =O/P1
//DD02 DD DSN =O/P2
//DD03 DD DSN =O/P3
//DD04 DD DSN =O/P4
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(DD01,DD02,DD03,DD04),SPLIT
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / amruta
you can use (if then do output options) conditional logic
statements.
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / muttiah
I'm not sure about the answers posted.But you can try this
simple JCL to achieve what you want.
//JOBCARD /*As per your company standard*/
//STEP1 EXEC PGM=SORT
//Sortin DD DSN=<Inputfile>,disp=shr
//SORT0F01 DD DSN=<FILENM1>,DISP=OLD
//SORT0F02 DD DSN=<FILENM2>,DISP=OLD
//SORT0F03 DD DSN=<FILENM3>,DISP=OLD
//SORT0F04 DD DSN=<FILENM4>,DISP=OLD
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY OR SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=1,ENDREC=1
OUTFIL FILES=02,STARTREC=2,ENDREC=2
OUTFIL FILES=03,STARTREC=3,ENDREC=3
OUTFIL FILES=04,STARTREC=4,ENDREC=4
/*
//
NOTE: I have given DISP=OLD which means it will override
the contents when you submit the jcl
If you want to create a new dataset replace like this
EX:
//SORT0F04 DD DSN=<FILENM4>,DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(1,4)),DCB=*.SORTIN
Hope this makes sense!!
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / chandan
You need to use ICETOOL utility and with Case statment. Pl
find the answer from ICETOOL pdf manual and test it.
| Is This Answer Correct ? | 0 Yes | 3 No |
Are there any set of rules for the names of the steps used in a job?
when GDG version number get changed ? bcz always Generations only increasing.
how can we override data definitions in jcl. can any one give detailed example
Does the terms, JOBLOG, SPOOL and SYSOUT indicate the same thing, i.e., where JCL and JES messages and statements are written ?
WHAT IS DUMMY IN JCL? HOW TO USE IT? CAN ANYBODY SEND PROGRAM ON THIS?
Explain about LMMLIST�list a library's members
IN MY JCL I VE 8 STEPS I WANT TO EXCUTE STEP 8 FIRST THEN EXCUTE STEP 4 ,HOW WILL EXCUTE STEP 8 BEFORE STEP 4?
7 Answers Cognizant, IBM, IGT,
how do u define a file in cobol and jcl ?
I have 15 flat files. each record in the files have the monthly salary for 12 months with the employee number. Now I want to concatenate the 15 files such that for the employee numbers that are common the o/p file should have only one record and the salaries should be concatenated to that record. How can we do it with JCL?
What is the difference between sb37,se37,sd37 each?
how do you resolve for soc7 error
how to split a file