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 |
How is the record format of an output dataset specified?
Why 16 is used in calculating the DPRTY ? as, DPRTY = (num1, num2), THEN, DPRTY = 16* num1 + num2
How to overide the symbol parameter in the jcl ?
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.
If Region=0k means What Happen?
If the proc stepname is excluded while overriding the COND, TIME, REGION and PARM parameters while calling the proc, will the override only apply to the first step in the proc or all the steps for all the above parameters?
i have 1000 records in input file and i want to sort it and the first 200 records to be placed in output file. how to do that??
is there any way to execute more than one proc in the same exec statement at the same time..?
What is the purpose of dd * statement in jcl?
How do you check the syntax of a JCL without running it?
I have 255 procedures in a job, each procedure contain 2 steps.can we execute this job?
TIME parameter in JOB statement or EXEC statement specifies What type of time (CPU time or execution time)?