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?
Answers were Sorted based on User's Feedback
Answer / satish
//job statement
//step1 exec pgm=sort
//sortin dd dsn=input file that contain 20 records
//file1 dd dsn=output file
//file2 dd dsn=another output file
//sysout dd sysout=*
//sysin dd *
option copy
outfil fnames=(file1,file2),split
/*
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / 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 |
Answer / bala
we can add seqnum to each record in the file using SORT
command and copy then use INCLUDE & EXCLUDE COND of SORT
for this.
| Is This Answer Correct ? | 1 Yes | 3 No |
How do you restart a PROC from a particular step?
How to see the COMP3 value(packd decimal)
How can the disposition of sysout datasets be set for an entire jobstream?
Can I send output of job to my remote device careerride123?
Can there be 2 job statements in a JCL? If yes what is the purpose of doing tha?
What is QSAM error usually when it is occurs?
Could anyone please suggest me what is the maximum length of data that can be pass as input in //sysin dd * This was asked in interview. TIA
i want apply mainframe devolper with 3+ but i dont have that much of knowledge what isthe solution to get that much of knoweldge?
How does jcl specify the job to the operating system?
What is the max blocksize for a Tape file?
what is the default region size if I dont specify region parametre in my job card ( I know that if I specify region=0k or 0M, then the job will occupy all he available resources at the time of job execution), but I want to know the defult value for "region" paramatre.
do we need to mention the location of catalogued procedure for each it's call in a single job?