IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Syncsort - query on joining two files


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Tue May 06, 2008 1:29 pm
Reply with quote

I have three i/pfiles of LRECL 20 bytes each.
My O/P file is a 60 byte file.

I need the contents of these I/P files to come horizontally one after the other ( record-1 of file-1 should occupy the first 20 bytes of output file, then record-1 of file-2 should occupy next 20 bytes of o/p file and record-1 of file-3 should occupy next 20 bytes of o/p file)..Like wise it should happen for all the records in the I/P file...

can I use JOINKEYS for this?? I dont(can't) have any field to be checked for joining the files as the I/P files have different values in the corresponding records...
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue May 06, 2008 2:25 pm
Reply with quote

AFAIK, you need a KEY to match them, if the key is the order you could use INREC with SEQNUM...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed May 07, 2008 5:10 am
Reply with quote

Hello,

You could generate a sequence number in each record of the 3 files. You could then join by the seqnum.

What should happen if there is not the same number of records in each file?

If this was my requirement, i'd write the tiny bit of cobol code to read the 3 files one itme and write the combined records to the 60-byte file.
Back to top
View user's profile Send private message
jsathishbabu84

New User


Joined: 07 Jun 2007
Posts: 22
Location: India

PostPosted: Tue May 27, 2008 11:49 am
Reply with quote

Hi Raak,

I feel this can be achieved using ICETOOL. Even if you dont have a common field among the files, it can be joined by generating sequence number provided the number of records in all the files should be same.

But i think the possibility is for joining only two files in a single step. You have to join first two files and then joined dataset with the third.

Regards,
SJ
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 27, 2008 9:53 pm
Reply with quote

Hello SJ,

Please carefully read the posts before replying - this topic is for Syncsort, not DFSORT/ICETOOL.

If one was to generate sequence numbers for all 3 files, then one could use MERGE with no problems.

As i mentioned before, if there are is no "key", a very simple bit of cobol code would give the output Raak requested. No conplexity and only one pass of the data. . .
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Wed May 28, 2008 11:46 am
Reply with quote

Hi raak,

Please check this link for your requirement.

Thanks,
Shankar
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts RC query -Time column CA Products 3
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top