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
 

 

Replacing spaces with key field, using syncsort v1.2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Replacing spaces with key field, using syncsort v1.2
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: 2239
Location: @my desk

PostPosted: Tue Jun 09, 2009 11:45 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Wed Jun 10, 2009 1:03 pm    Post subject:
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: 500
Location: USA

PostPosted: Sat Jun 13, 2009 3:24 am    Post subject:
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    Post subject:
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    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 SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm
No new posts 2 byte YEAR from Y'DATE2' field tecnokrat DFSORT/ICETOOL 2 Tue Feb 07, 2017 12:05 pm


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