a input file contains 1000 records, how to move the first
500 record into one out put file and how to move to second
500 records to anothere output file
Answer Posted / varsha
Using SPLITBY option, you can do it in one step only -
//JOBNAME
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=INPUT DSN,DISP=SHR
//OUT1 DD DSN=OUTPUT DSN1,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//OUT2 DD DSN=OUTPUT DSN2,DISP=(NEW,CATLG),
// SPACE=(CYL,(5,5)),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(OUT1,OUT2),SPLITBY=500
/*
//
Please correct .. if I am wrong
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
when does a dataset go uncataloged?
What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?
What are the parameter we cannot use in procedure? How many instream we can write in single jcl?
List the different jcl statements that are not permitted in the procedures?
how to run batch program without jcl?
I have many files which i am receiving from client everyday. I have one step for every file to check for empty or not. Here client gives 30 files i need to check for every file for empty or not and i need to perform 30 steps. Can I do it in single step. Dynamically i need to change the File name in my step.
What does it mean by Restart and Checkpoint in JCL ? How are checkpoints being taken and what is their usage ? How to use Checkpoint macro on a JOBSTEP ?
What is the use of disp parameter?
Is acct parameter mandatory?
What is notcat 2 - gs?
What is the function of dd name parameter with a 2 part structure; audit.report?
what is DSN parameter and DISP parameter is used for?
Explain the function of //cntl statement?
I want to JCL sort for Non-COMP and COMP-3 fields SORT FIELDS=(1,5,A,6,11,A,12,11,A,19,1,A,20,1,A),FORMAT=BI,EQUALS Length of comp bytes is 11 bytes which start at 6byte and 12 byte considering 11 bytes in comp-3 is 6 bytes. Can anyone tell if the above sort work SORT FIELDS=(1,5,A,6,6,A,12,6,A,19,1,A,20,1,A),FORMAT=BI,EQUALS does not works OK
Name what parameter directs the output of the job log dataset?