Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 5 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us