I have a file in which I have 20 records. I want my first
record to go into file 1 and second record to go in second
file. I want to copy the alternate records like this in the
two output files. How can I do this using JCL?
Answer Posted / muttaiah
Adding to satish answer.
Option copy is similar to sort fields= copy or merge
fields=copy.
It is used to simply copy the records from input to output
file.
Outfil is used when we want to do process records in the
input file.
Here split option is used in Outfil to seperate the input
file into 2, that means it will write the alternate records
into the files specified in fnames.
Other syntax of Outfill would be
//step1 exec pgm=sort
//sortin dd dsn=Inputfile
//sortof01 dd dsn=file1
//sortof02 dd dsn=file2
//sysin dd *
option copy
outfil files=(01,02),split
/*
Here we are giving 01,02 which indicates the DDnames that
are prefixed with sortof.
Hope this makes sense in understanding satish answer
@All: Do correct me if i'm wrong.
Thank u
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
List the various advantages of using jcl language?
what JCL Procedures?
Can we use DISP=SHR in output file in JCL
how you can direct the data to spool using SYSOUT option?
What dd statement is used to supply the name of a dataset?
if we want to use a gdg which is already created by some job, then how to use the reference of the last generation in a jcl?
What do you understand by the term notcat 2 – gs?
Mention the types of job control statements?
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 is DSN parameter and DISP parameter is used for?
what EXEC statement is and what is the syntax of EXEC statement used in JCL?
How do you access an uncatalogued dataset in a jcl?
which parameter is use to declare the name of dataset in dd statement?
A chkpt is the parameter coded for multi-volume qsam datasets in a dd statement. When a chkpt is coded as chkpt=eov, a checkpoint is written to the dataset specified in the sysckeov statement at the end of each volume of the input/output multi-volume dataset. State whether true or false?