Page 1 of 1

copy already sorted data

PostPosted: Sun Nov 21, 2010 5:29 pm
by jnkarthik
Hi,
I have two input files as below
In1 Dataset name 'MY.DATA1'
Var1 DATA1
----- --------
XYZ 20000
abc 25000
123 30000

in2 Dataset name 'MY.DATA2'
VAR2 DATA2 DATA3 DATA4 DATA5
------ ------- ------- ------- --------
XYZ 05000 a b c
abc 17000 a
123 10000 X

My Output should be as below
XYZ 20000 a b c
abc 25000 a
123 30000 X

My DATA1 in input file is update data which i need to update in INPUT2 rest of input2 should be same.
Can it be achieved in DFSORT?
Can it be updated in 'MY.DATA2' dataset means it will be my input and output dataset as well, can this be done?

Re: copy already sorted data

PostPosted: Sun Nov 21, 2010 10:34 pm
by dick scherrer
Hello,

Do not overwrite input data during a process (sort or otherwise). If there is a problem, the input data is corrupted/destroyed. Well managed environments will not allow this.

Process the 2 input files and write a new output file.

Yes, this can be done using DFSORT. Suggest you review topics that JOIN 2 files. There are examples in the forum.

Re: copy already sorted data

PostPosted: Tue Nov 23, 2010 12:48 am
by Frank Yaeger
jnkarthik,

What is the RECFM and LRECL of each file?

What is the starting position, length and format of each relevant field?