Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 2285
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: 8597
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
This topic is locked: you cannot edit posts or make replies. Incrementing current time field by 30... arunsoods DFSORT/ICETOOL 11 Thu Oct 26, 2017 3:22 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us