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

Replacing spaces with key field, using syncsort v1.2


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

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Tue Jun 09, 2009 3:31 pm
Reply with quote

Hi,
FB input file has the key field at position 1 to 4 and data filed varies from 6 to 80.
Code:
KEY1 DATA1 DATA2                                         
     DATA3 DATA4                                         
KEY2 DATA1 DATA2                                         
     DATA3 DATA4                                         
     DATA5 DATA6                                         
KEY3 DATA1 DATA2                                         
     DATA3 DATA4                                         
     DATA5 DATA6                                         


The required output is
Code:

KEY1 DATA1 DATA2                                             
KEY1 DATA3 DATA4                                             
KEY2 DATA1 DATA2                                             
KEY2 DATA3 DATA4                                             
KEY2 DATA5 DATA6                                             
KEY3 DATA1 DATA2                                             
KEY3 DATA3 DATA4                                             
KEY3 DATA5 DATA6                                             


The spaces in the input file should populated with the Key field.Is this possible in Synsort?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Jun 09, 2009 11:45 pm
Reply with quote

Quote:
Is this possible in Synsort?
kalpana manohar,

Yes it is. May be you'll have to use a SYNCTOOL job to accomplish this. I am away from office now and cant do a test. icon_sad.gif
Back to top
View user's profile Send private message
kalpana manohar

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Wed Jun 10, 2009 12:56 pm
Reply with quote

Arun,
Thanks for the update. It would be helpful, if provided with the sample code to achieve this functionality.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Jun 10, 2009 1:03 pm
Reply with quote

kalpana manohar wrote:
Arun,
Thanks for the update. It would be helpful, if provided with the sample code to achieve this functionality.

And just exactly what have YOU tried yourself before asking for code ?
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Jun 13, 2009 3:24 am
Reply with quote

Here is a SyncSort for z/OS 1.2 job that will produce your requested output:
Code:
//SORT1  EXEC PGM=SORT                   
//SORTIN   DD *                                                       
KEY1 DATA1 DATA2                                                     
     DATA3 DATA4                                                     
KEY2 DATA1 DATA2                                                     
     DATA3 DATA4                                                     
     DATA5 DATA6                                                     
KEY3 DATA1 DATA2                                                     
     DATA3 DATA4                                                     
     DATA5 DATA6                                                     
//SORTOF01 DD DISP=(NEW,PASS),DSN=&&TEMP1,SPACE=(TRK,1),UNIT=SYSDA   
//SORTOF02 DD DISP=(NEW,PASS),DSN=&&TEMP2,SPACE=(TRK,1),UNIT=SYSDA   
//SYSOUT   DD SYSOUT=*                                 
//SYSIN    DD *                                         
  INREC IFTHEN=(WHEN=INIT,                           
       OVERLAY=(81:SEQNUM,8,ZD)),                     
        IFTHEN=(WHEN=(1,1,CH,NE,C' '),               
       OVERLAY=(81:SEQNUM,8,ZD)),                     
        IFTHEN=(WHEN=NONE,                           
       OVERLAY=(89:SEQNUM,8,ZD,                       
                81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))
  SORT FIELDS=COPY                                   
  OUTFIL FILES=01,INCLUDE=(1,1,CH,NE,C' ')           
  OUTFIL FILES=02,INCLUDE=ALL                         
/*                                                   
//STEP2  EXEC PGM=SORT               
//SYSOUT   DD SYSOUT=*               
//SORTOUT  DD SYSOUT=*               
//SORTJNF1 DD DISP=SHR,DSN=&&TEMP1 
//SORTJNF2 DD DISP=SHR,DSN=&&TEMP2 
//SYSIN    DD *                       
  JOINKEYS FILE=F1,FIELDS=(81,8,A) 
  JOINKEYS FILE=F2,FIELDS=(81,8,A) 
  REFORMAT FIELDS=(F1:1,4,F2:5,76) 
  SORT FIELDS=COPY 
/*               
Back to top
View user's profile Send private message
kalpana manohar

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Fri Jun 26, 2009 3:54 pm
Reply with quote

Alissa,
Thanks much for your kind reply and it's working as desired.
Sorry for my delayed response
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts Join 2 files according to one key field. JCL & VSAM 3
Search our Forums:

Back to Top