Merge 2 records into single, involves reformating too



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

Merge 2 records into single, involves reformating too

Postby hariharan_bk » Thu Oct 09, 2014 7:18 pm

Hi Team,

I need to merge 2 records into one single record. Could you please help

INPUT: (VB/120)
First record:
There are 59 bytes which remain as spaces from position 50. And we will have date at the end.
second record:
This record will have data (non spaces ex:HH) for those 59 bytes.

********************************* Top of Data **********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX  ,                    20141004,   
                                                 HHHHHHHHHHHHHH,
******************************** Bottom of Data ********************************


Output expected: (VB/120)
These 2 input records are to be merged to get the complete merged single record
********************************* Top of Data **********************************
DTL,XXXXXXXX.XXXXXXXX.CXXXX.ITEXXXX.INPXX  ,  HHHHHHHHHHHHHH, 20141004,   
******************************** Bottom of Data ********************************


Code I tried which dint work yet:
 SORT FIELDS=COPY                                               
 INREC IFTHEN=(WHEN=GROUP,RECORDS=2,PUSH=(121:SEQ=1,50,59)),     
 IFTHEN=(WHEN=(121,1,ZD,EQ,2),BUILD=(1,4,5,45,50:122,59,109,12))
 OUTFIL BUILD=(1,120)                                           


Program used:
//STEP111 EXEC PGM=SORT

The job ran fine but output is not as expected. Could someone pls check and advise us back.
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Re: Merge 2 records into single, involves reformating too

Postby hariharan_bk » Sun Oct 12, 2014 12:56 am

Hi All,

Could someone pls help here on the above request. Thanks !!
Many Thanks,
Harry
hariharan_bk
 
Posts: 73
Joined: Thu Mar 29, 2012 11:13 am
Has thanked: 5 times
Been thanked: 0 time

Re: Merge 2 records into single, involves reformating too

Postby NicC » Sun Oct 12, 2014 3:53 am

Why should they? You know you have syncsort. You know there is another section of the forum for syncsort queries but you ignore that and post in a rival company's section. I could, of course, simply delete the topic but I will move it for you.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Merge 2 records into single, involves reformating too

Postby BillyBoyo » Sun Oct 12, 2014 6:15 am

For variable-length records, it is usual to extend for temporary fields at the beginning of the record. That's just to emphasise "usually", at it doesn't matter here.

The first record has A blank C, the second blank B blank. If you PUSH A into the location it came from, similar with C, then when you look at the second record it will have A B C. Remove the second IFTHEN, put INCLUDE= for 2 on the OUTFIL, and you should be about there.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post