I have two files each contains 10 records. I would like to
copy both files into one output file but in alternate
sequence. for e.g. first record from file1 then record 2
from file2.....
Answers were Sorted based on User's Feedback
it will be processed in 3steps
if the data is AAA
AAA
BBB
CCC
FILE2
DDD
EEE
FFF
LIKE 10 RECS
step1:
srt fields=copy
outrec fields=(1:1,3,4:seqnum,4,ZD,START=1,INCR=2 )
STEP:2
step2:
srt fields=copy
outrec fields=(1:1,3,4:seqnum,4,ZD,START=2,INCR=2 )
STEP=3 SORT FIELDS = COPY
OUTREC FIELDS =(1:1,3)
| Is This Answer Correct ? | 9 Yes | 0 No |
Answer / muttaiah
Mallikarjuna,
If you give sort=copy in step3. the format of o/p file is
rec1 - File1
rec2 - File1
Rec1 - File2
rec2 - File2
change the sort as:
sort fields=(4,4,ZD,A)
outrec fields=(1:1,3)
rec1 - File1
Rec1 - File2
rec2 - File1
rec2 - File2
| Is This Answer Correct ? | 6 Yes | 0 No |
Answer / aks
Use df sort utility and use infile and outfile for writing
the record into output file.
| Is This Answer Correct ? | 1 Yes | 1 No |
Is condition checking possible in jcl? If yes, how?
how can u understand ps and pds from their names ?
Explain about RECORDING MODE Clause
I had 100 steps in jcl i want to execute first 10 steps only?
What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
lines(1,cancel)??What is meant by that??Plz explain it....
I have a dataset with record length 40 in production, due to some requirements it was changed to 80. Then how can we know the jobs which are effected by this change and how can we resolve it.
Can we change a FB file to VB file in JCL? Please help
What is the differentiation between TRK,cyl, and Bytes... how they can be connected??
What is STEPLIB, JOBLIB? What is it used for?
how to split a file
what is fixed length and variable length and difference between them