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
Explain how can the attributes of one sms dataset be copied to another dataset?
How jcl is used for testing batch programs?
How do you create a temporary dataset?
WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99 VALUE 123.45. PROCEDURE DIVISION. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. compiler : IGYGR1080-S A "VALUE" clause literal was not compatible with the data category o subject data item. The "VALUE" clause was discarded. WORKING-STORAGE SECTION. 77 W-A PIC 9(3)V99 VALUE 23.75. 77 W-B PIC ZZ9V99. PROCEDURE DIVISION. MOVE 123.45 TO W-B. MOVE W-A TO W-B. DISPLAY W-B. STOP RUN. 2375
Is it possible to left uncode disp?
What is the function of dd disp parameter?
What statement marks the beginning of an in-stream or cataloged procedure in jcl and assigns default values to parameters defined in the procedure?
what is use of dcb parameter in dd statement?
what is the JCL statement consists of?
What are the parameters that are used in creating a gdg?
What is the function of the dd mgmtclas keyword in sms datasets?
How do you run a COBOL batch program from a JCL? How do you run a COBOL/DB2 program?
Suppose I have five jobs to do. But I want to hold one?
I HAVE A VB BLOCK WHICH IS USED AS INPUT IN COBOL CONATINING SOME RECORDS CAN I CHANGE THE FILE FROM VB TO FB?
Describe the various parameters utilized in the creation of a gdg?