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



In one of intervie, my interviwer asked, I have a file which contains 4 records I would like to sp..

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

In one of intervie, my interviwer asked, I have a file which contains 4 records I would like to sp..

Answer / amruta

you can use (if then do output options) conditional logic
statements.

Is This Answer Correct ?    0 Yes 0 No

In one of intervie, my interviwer asked, I have a file which contains 4 records I would like to sp..

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

In one of intervie, my interviwer asked, I have a file which contains 4 records I would like to sp..

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

Post New Answer

More JCL Interview Questions

I have one GDG. Everyday One new version is being created.Now I want to split this created version in different files each having 1000 records. Here Problem is I don't know How many records will be there in new version of GDG? that's why I don't know How many Out files we need to use . Interesting??????????????

4 Answers   CTS,


i want apply mainframe devolper with 3+ but i dont have that much of knowledge what isthe solution to get that much of knoweldge?

1 Answers  


Explain about LMGET�read a logical record from a data set

1 Answers  


how to eliminate the duplicates in sorting

4 Answers   Fidelity,


What is GDG?

1 Answers  






How to search strings in multiple dataset with conditions 'string1 & string2'?

1 Answers   IBM,


What are the 2 types of parameters in dd statement?

0 Answers  


i have 10,000 records in one input file.i want to sort 1 to 5000 records in one outputfile and remaining records sort in another output file write the syntax for this?

4 Answers   DELL,


1) Is CLASS used for assigning Priority (as we say a job having class '6' will run before the job having class '5'? then what is the difference between CLASS and PRTY ? 2) In a same JCL, 2 JOB statements with different Classes and NO PRTY are submitted ? which will run first ? & with different classes and different PRTY also, which will run first now ?

3 Answers   IBM,


what is use of disp parameter in dd statement?

0 Answers   IBM,


Which COND paramter will u use to execute the step only if the previous step does not execute

3 Answers   BoA, HSBC,


Explain dfsort utility?

0 Answers  


Categories