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 |
Is it possible to take a PDS and write it to a GDG? If so, can you provide an example? Thanx
what is the use of JCL?
what is the alternative to model parameter?
How can values be passed from the job stream to an executable program?
how can handle the s0c4 abend???
How can you execute a COBOL program via SYSIN in JCL?
How do you submit JCL via a Cobol program?
describe the exec statement,its meaning ,syntax and keywords?
What are the parameter in the job card wihtout which job won't run........
What does a disposition of (new,catlg,keep) for a dsn mean?
if we have a job consist of two steps and each step calling a proc having 10 steps each then how many steps are counted only 2 or 22(10+10+1+1)? can we have more than 255 steps in a single job?
how do you code a null statement?