Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Merge 2 files whose merge fields have the same seq number

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
ravven16

New User


Joined: 22 Aug 2006
Posts: 16

PostPosted: Wed Aug 30, 2006 3:16 pm    Post subject: Merge 2 files whose merge fields have the same seq number
Reply with quote

Hi group,

I have one requirement to merge 2 files whose merge fields is a sequence number.My first file has the seq number from 1 to 500 and my second file has sequence number from 1 to 250. after merging I want the second file to merge with sequence number 501 and so on. is it possible to do this using sort, please provide me a solution.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Aug 30, 2006 8:35 pm    Post subject:
Reply with quote

I don't understand what you want to do. "Merge" has a specific meaning and it doesn't seem like your use of the term "merge" fits that meaning. Please show an example of the input records in each file and what you expect the output records to look like. What is the starting position, length and format of the sequence number? What is the RECFM and LRECL of the input files.
Back to top
View user's profile Send private message
ravven16

New User


Joined: 22 Aug 2006
Posts: 16

PostPosted: Thu Aug 31, 2006 12:49 pm    Post subject: Re: Merge 2 files whose merge fields have the same seq numbe
Reply with quote

Hi,

I have two files A and B whose length is 80 bytes. The first 6 bytes denotes the sequence number which starts from 1 for both the files. I want to merge both the files such that the details of the second file should follow the first file and the sequence number should be incremented. Is it possible through sort

FILE A:

00000101016620AAU 3583 1GMXAA 1DPZJAJF 3583
00000201016620AAU 3583 1GMXBA 1DPZJAJF 3583
00000301016620AAU 3583 P1GMXAA 16620AAU 3583

FILE B:

00000101016620AAU XF 295132 1200602A8001R
00000201016620AAU XF 295132 1200702A8001R
00000301016620AAU 2159 VP2HNXAA 1200602A8001R

OUTPUT:

00000101016620AAU 3583 1GMXAA 1DPZJAJF 3583
00000201016620AAU 3583 1GMXBA 1DPZJAJF 3583
00000301016620AAU 3583 P1GMXAA 16620AAU 3583
00000401016620AAU XF 295132 1200602A8001R
00000501016620AAU XF 295132 1200702A8001R
00000601016620AAU 2159 VP2HNXAA 1200602A8001R
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Aug 31, 2006 9:11 pm    Post subject:
Reply with quote

Actually, you just want to copy the concatenated files and resequence the ouput records. You can do that with this DFSORT job:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//       DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC OVERLAY=(1:SEQNUM,6,ZD)
/*
Back to top
View user's profile Send private message
ravven16

New User


Joined: 22 Aug 2006
Posts: 16

PostPosted: Thu Sep 14, 2006 7:43 pm    Post subject: Re: Merge 2 files whose merge fields have the same seq numbe
Reply with quote

Thanks Frank, It works great......
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT BUT RETAIN HIGHEST VALUE ON NON-... leondan22 DFSORT/ICETOOL 2 Thu Dec 14, 2017 8:13 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us