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 |
I have a JCL which 20 steps. How do I execute 17 th step alone (It should execute only 17ths tep.and it should not execute 18,19,20 steps??
9 Answers IBM, Infosys, TCS, Xansa, Xchanging,
i have records from 1 t0 100 . i need to open records from 10 to 18 and change the values in tht ? how can i do tht ?
what is the cond=even only
In JCL I have 5 steps,I need to execute 1st,2nd and 5th steps only,can any one answer me please?
Write a JCL by using the below requirement: File1 =1, File2 =11 and output needs to come as File3 =111?
Is Default for MSGCLASS = (1,1) ?
hi guys what r the diff types of procs in jcl? bye ramya
4 Answers ACS, Keane India Ltd,
How to override loadlib?
what EXEC statement is and what is the syntax of EXEC statement used in JCL?
can we have more than one job in a single job card that is we are specifying only one 'job' statement in the jcl.
What is a JCL Command statement ?
wht r different types of sorts ?