how to split a file

Answer Posted / himanshu

Using SORT utility we can split the file. Sort card will be
as:

//SYSIN DD *
SORT FIELDS=COPY
OUTFILE FNAMES=(SORTOUT1,SORTOUT2,SORTOUT3),SPLIT
/*

If there are 10 records in input and these have to be split
across three files SORTOUT1, SORTOUT2 and SORTOUT3
respectively. After running the Job using this sort card,
record1 would be stored in SORTOUT1, record2 in SORTOUT2,
record3 in SORTOUT3, record4 in SORTOUT1 and so on.

Is This Answer Correct ?    18 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how can the submitting users racf authority be overridden in a job stream?

758


How to find the UNIT and VOLUME of a (a) KEPT (b) UNCATALOGED and (c) CATALOGED dataset - using (i) JCL and using (ii) ISPF ?

2285


How does jcl act on a cobol code?

731


What is concatenating?

717


In sms datasets, what is the function of the dd mgmtclas keyword?

976






When output dataset space is required, what quantity categories are used?

948


what is DSN parameter and DISP parameter is used for?

764


how can you check if a file is empty using jcl?

909


how JCL works?

882


What is 'mounting' of volumes ? Is there anything that a programmer can do in it ? How to find currently mounted volume ?

2086


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.

814


How do you submit a job for execution?

719


which utility is used to sort a file in jcl?

850


What statement can be used to send data to another mvs jes3 node?

1069


What is the syntax of JCL statement?

787