Page 1 of 1

APPENDING/MERGING 2 files who's LREC is different

PostPosted: Sun Feb 17, 2013 1:17 pm
by geek
Hi ,

I have two files who's LREC is different ,when i'm trying to append/merge ,the data is actually copied/over writing the data present in the output file.
below is the code I have used

first file lrec is 50 and second file lrec is 200

the output :some data which is unknown
some data

but the actual required output is
12345678
some data which is unknown
some data

please help me out

//step exec pgm=icetool
//toolmsg dd sysout=*
//dfsmsg dd sysout=*
//input1 dd *
12345678
/*
//input2 dd *
some data which is unknown
some data
/*
//output dd sysout=*
//toolin dd *
copy from(input1) to(output)
copy from(input2) to(output) using(ctll)
/*
//ctllsntl dd *
outrec overlay=(50:X)
/*

Re: APPENDING/MERGING 2 files who's LREC is different

PostPosted: Sun Feb 17, 2013 3:31 pm
by BillyBoyo
What is the RECFM of the files?

Can you give representative sample data for both input files and expected output.

Re: APPENDING/MERGING 2 files who's LREC is different

PostPosted: Mon Feb 18, 2013 10:44 am
by geek
can any one suggest different ways available for merging two files of diffrent lrec

recfm is fb for both the files ,but the thing is lrec is different .
sample input:

file1:12345689

file2:(it contains hell lot of data) for ex
aaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbb
expected output:

12345689
aaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbb

Re: APPENDING/MERGING 2 files who's LREC is different

PostPosted: Mon Feb 18, 2013 12:50 pm
by BillyBoyo
Can you run this, please, and post the SYSOUT from the step, in the code tags like I've done for this JCL.

//S1 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN DD *
RECORD
/*
//SORTOUT DD DUMMY
//SYSIN   DD   *
  OPTION COPY


This will tell us what level of Sort product you have, so we don't spend time thinking of solutions which won't work for you.

Re: APPENDING/MERGING 2 files who's LREC is different

PostPosted: Mon Feb 18, 2013 11:50 pm
by skolusu
geek wrote:Hi ,

I have two files who's LREC is different ,when i'm trying to append/merge ,the data is actually copied/over writing the data present in the output file.


What is the DISP on the DD OUTPUT? You need to have DISP=(MOD,CATLG,DELETE) if you need the data to be appended.