How to concatenate data in column wise format



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

How to concatenate data in column wise format

Postby ana » Thu Apr 14, 2011 12:37 am

Hi,

I need to concatenate data from two different files in a column wise manner as shown in the below example. File 1 and File 2 has no common key. Also I have around 30,000 records in both the files.

Example:

Input:
File 1 -->
AAAAA
BBBBB
CCCCC
DDDDD

File 2 -->
11111
22222
33333
44444

Output:
AAAAA11111
BBBBB22222
CCCCC33333
DDDDD44444

Thanks,
Ana
ana
 
Posts: 4
Joined: Thu Apr 14, 2011 12:14 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to concatenate data in column wise format

 

Re: How to concatenate data in column wise format

Postby NicC » Thu Apr 14, 2011 1:01 am

I suggest that you look at some of the other sort topics and see how much information you are missing in your post and then do another post with the missing info.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2702
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to concatenate data in column wise format

Postby ana » Thu Apr 14, 2011 1:25 am

Thanks Nic, hope I will not miss any information this time.

I need to concatenate data from two different files in a column wise manner as shown in the below example. File 1 and File 2 has no common key.

File 1: 5 bytes, FB format
Record layout:
AAAAA
BBBBB

File 2: 14 bytes, FB format
Record layout:
11111111111111
22222222222222

Output file: 19 bytes, FB format
Record layout:
AAAAA11111111111111
BBBBB22222222222222

Please let me know if I am still missing any information.

Thanks,
Ana
ana
 
Posts: 4
Joined: Thu Apr 14, 2011 12:14 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to concatenate data in column wise format

Postby NicC » Thu Apr 14, 2011 9:56 am

You show both files as having the same number of records - but what if they do not?
You just join the records from file 1 with file 2 regardless of whether the data for the 2 records relate to the same entity or not? Seems pointless unless this is just learning exercise for JOINKEYS for which there are many solutions in the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2702
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: How to concatenate data in column wise format

Postby ana » Thu Apr 14, 2011 11:31 am

Hi Nic,

Both the files have same number of records. The first record in the File 1 is related to the first record in File 2 and this goes on till the last record.
I can only use JOINKEYS if there were any common keys between File 1 and File 2.

Any suggestions would be very helpful.

Thanks,
Ana
ana
 
Posts: 4
Joined: Thu Apr 14, 2011 12:14 am
Has thanked: 0 time
Been thanked: 0 time

Re: How to concatenate data in column wise format

Postby Alissa Margulies » Fri Apr 29, 2011 8:33 pm

Hello Ana.

One way to accomplish this task is to pre-process each of the input files and insert a sequence number. In another step, you can JOIN on that SEQNUM field, and then strip it out using the REFORMAT statement.

Regards,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: How to concatenate data in column wise format

Postby ana » Tue May 03, 2011 1:48 am

Thanks you Alissa, this is working now.

Regards,
Anamika
ana
 
Posts: 4
Joined: Thu Apr 14, 2011 12:14 am
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post