MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

merging records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 11:03 am    Post subject: merging records Reply with quote

hi,
I need a sort conditionto merge two files into the one file.

Please find the details:
input file:
file 1 : 1st position to 15th position having data (acct-nbr)
file 3 : 16th postion to 32nd positio having data (name).

Output file:
output file: 1st to 15th position (acct nbr),16th to 32nd (name)
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 10, 2010 11:19 am    Post subject: Reply with quote

puttu,

huh? What is the Matching key in both files?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 11:25 am    Post subject: Reply with quote

kolusu,
in file 1 we have starting position 00 for all reords.
in file 2 we have starting position 2010 for all records.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 10, 2010 11:37 am    Post subject: Reply with quote

Puttu,

Did you even read my post? bonk

Please read this post and see how to explain your requirement

http://www.mvsforums.com/helpboards/viewtopic.php?p=54768#54768
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 11:59 am    Post subject: Reply with quote

kolusu,
a bit confusion...
can u please send a exact code for my requirement....
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 10, 2010 12:17 pm    Post subject: Reply with quote

puttu wrote:
kolusu,
a bit confusion...
can u please send a exact code for my requirement....


bonk just unbelievable
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 12:46 pm    Post subject: Reply with quote

kolusu,

for my requirement. i dont want to check key.
just i want to merge.
Back to top
View user's profile Send private message Send e-mail
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 1:41 pm    Post subject: Reply with quote

Hi kolusu,

Please find the detailed explanation of my requirement:

need a sort conditionto merge two files into the one file.

Please find the details:
input file:
file 1 : 16th postion to 31st position having data.
file 2 : 1st position to 15th position having data.

Output file:
output file: 1st to 15th position ,16th to 32nd

input file 1 format:
from 1st postion spaces, 16th to 31 having date.

file 2 format:
1st to 15th time stamp

output should be:
1,16 date, 17,15 timestamp
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 10, 2010 2:14 pm    Post subject: Reply with quote

puttu,

bonk you don't get it don't you? sigh ok explain me from the following input

File 1 has 5 records like shown below

File 2 has only 3 records like shown below.

if the criteria is to match record-1 or file 1 with record-2 of file 2 then then the output is shown below.

Now the question is what happens when the files DO NOT have the same number of records like shown below?

Technically you ALWAYS will have a KEY if you want to merge contents from 2 different files. In this case it is the record number. Remember that we can't see your data nor read your mind. So Please specify everything so that we wont be wasting time.



FILE : 1
Code:

----+----1----+----2----+----3----+----4----+----5--
               AAAAAAAAAAAAAAAA - RECORD 01         
               BBBBBBBBBBBBBBBB - RECORD 02         
               CCCCCCCCCCCCCCCC - RECORD 03         
               DDDDDDDDDDDDDDDD - RECORD 04         
               EEEEEEEEEEEEEEEE - RECORD 05         


FILE : 2
Code:

----+----1----+----2----+----3----+----4----+----5--
111111111111111 - RECORD 01                         
222222222222222 - RECORD 02                         
333333333333333 - RECORD 03                         



OUTPUT :
Code:

----+----1----+----2----+----3----+----4----+----5--
AAAAAAAAAAAAAAAA 111111111111111                   
BBBBBBBBBBBBBBBB 222222222222222                   
CCCCCCCCCCCCCCCC 333333333333333                   
DDDDDDDDDDDDDDDD ????????
EEEEEEEEEEEEEEEE ????????

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
puttu
Beginner


Joined: 29 Jul 2010
Posts: 41
Topics: 9

PostPosted: Tue Aug 10, 2010 2:38 pm    Post subject: Reply with quote

kolusu,
what u taken examples & output also correct.
here in my case always both the files will have same records 100%.
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Aug 10, 2010 2:46 pm    Post subject: Reply with quote

puttu,


Use the folloiwng DFSORT JCL which will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//INA      DD *                           
               AAAAAAAAAAAAAAAA           
               BBBBBBBBBBBBBBBB           
               CCCCCCCCCCCCCCCC           
//INB      DD *                           
111111111111111                           
222222222222222                           
333333333333333                           
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                           
  OPTION COPY   
  JOINKEYS F1=INA,FIELDS=(33,8,A),SORTED,NOSEQCK
  JOINKEYS F2=INB,FIELDS=(33,8,A),SORTED,NOSEQCK                           
  JOIN UNPAIRED                           
  REFORMAT FIELDS=(F1:16,16,F2:1,15)     
//JNF1CNTL DD *                           
  INREC OVERLAY=(33:SEQNUM,8,ZD)         
//JNF2CNTL DD *                           
  INREC OVERLAY=(33:SEQNUM,8,ZD)         
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group