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 ? | 5 Yes | 0 No |
Post New Answer View All Answers
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?
How to pass data to a program that is coded in an exec statement?
I have a cobol db2 program(PGM A) where other program (PGM B) will call this program and passes some 50 fields data to PGM A. PGM A has some layout in which it receives the data from PGM B. And this layout has been copied in the linkage section pf PGM A. After getting the data, PGM A writes the data in a flat file in the same layout which it receives from PGM B. PGM B is a simple COBOL pgm. Please provide a JCL to run these programs.
What is concatenating?
Explain the function of //cntl statement?
What does a disposition of (MOD,DELETE,DELETE) mean ?
Can an individual step be restricted from using all the jobs allowed cpu time?
What is the purpose of dd?
hello friends ,i have exam in Hsbc,pls any on send me placement papers and technical questions on mainframes,thank u
Explain dfsort utility?
I want my job (careerride) to be executed in 1 minute and 2 seconds. How do I do that?
Explain how can the disposition of sysout datasets be set for an entire jobstream?
how you can direct the data to spool using SYSOUT option?
Where & How Do You Code Identifier In Jcl?
I have a job called careerride and some steps in it as step1,step2. But I want to execute step2 before step1 ? How do I do that?