APPENDING/MERGING 2 files who's LREC is different



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

APPENDING/MERGING 2 files who's LREC is different

Postby geek » Sun Feb 17, 2013 1:17 pm

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)
/*
geek
 
Posts: 2
Joined: Sun Feb 17, 2013 12:58 pm
Has thanked: 0 time
Been thanked: 0 time

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

 

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

Postby BillyBoyo » Sun Feb 17, 2013 3:31 pm

What is the RECFM of the files?

Can you give representative sample data for both input files and expected output.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby geek » Mon Feb 18, 2013 10:44 am

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
geek
 
Posts: 2
Joined: Sun Feb 17, 2013 12:58 pm
Has thanked: 0 time
Been thanked: 0 time

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

Postby BillyBoyo » Mon Feb 18, 2013 12:50 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

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

Postby skolusu » Mon Feb 18, 2013 11:50 pm

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.
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post