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 |
Can I copy the FB (fixed Block) record length file to a VB (variable Block)record length file and Vise Versa? If Yes then how ? is that thru one of the JCL utility ?
How system will identify whether user wants to create PS or PDS? If answer is SPACE parameter then why we need to pass ps or po as dataset organisation while creation
how to count the number of members in pds?
I had 100 steps in jcl i want to execute first 10 steps only?
What is model dataset label(Model DSCB)?
What dd statement is used to supply the name of a dataset?
in job stmt i coded time=(2,30) and in step 1 i coded time=(1,30) and in step i coded time=(1,30), whch one executes first and what happens if step1 and step2 time executes and wht about the remaining time if step and step2 executes
01 GROUP-ITEM 05 AMOUNT-1 PIC 99V9 USAGE COMP VALUE 50 05 AMOUNT-2 PIC 9(4)V99 USAGE COMP MOVE ZERO TO GROUP-ITEM ADD 50 TO AMOUNT-1 what will be the content of AMOUNT-1? a.50 b.100 c.0 d.unpredictable
Hi, all Suppose i have 10 step in a job (s1,s2,s3,...s10) i want to execute step9 first and then step3 and i used the DPRTY for these steps. so what will happen to other steps? Will the get executed or only these two steps get executed?
What is meant by S0C7 system abend code?
Is condition checking possible in jcl? If yes, how?
read all error codes like SB07?