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
 

 

Syncsort - query on joining two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort - query on joining two files
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    Post subject:
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

Site Director


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

PostPosted: Wed May 07, 2008 5:10 am    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Tue May 27, 2008 9:53 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am


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