MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help using syncsort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Shreeni
Beginner


Joined: 11 Aug 2006
Posts: 3
Topics: 1

PostPosted: Fri Aug 11, 2006 1:42 pm    Post subject: Need help using syncsort Reply with quote

Need help.

I have got a requirement like this.

I have a 173 byte file.

Policy number from positons 28 to 45 (18 bytes) . Dec number is in 46th position (1byte) Needs to update 138 position , with N if it is dubplicate record and has least dec number, with Y if it is duplicate record and not a least dec number, space if it is not duplicate record (single record).
File before :
Code:

<policy number>    <number>      <name>    ^ upd field
ABCDEFGH0010000001  2            ROLAND   
ABCDEFGH0010000002  0            JARREL   
ABCDEFGH0010000002  1            JARREL   
ABCDEFGH0010000003  0            HAMPEL   
ABCDEFGH0010000301  0            HENKEL   
ABCDEFGH0010000062  0            THORNT 
ABCDEFGH0010000010  0            WHITTI   
ABCDEFGH0010000010  1            WHITTI 

ex : pplicy number ABCDEFGH0010000001, dec number is 2 .

File after syncsort :
Code:

<policy number>    <number>      <name>    ^ upd field
ABCDEFGH0010000001  2            ROLAND   
ABCDEFGH0010000002  0            JARREL       N   
ABCDEFGH0010000002  1            JARREL       Y   
ABCDEFGH0010000003  0            HAMPEL   
ABCDEFGH0010000301  0            HENKEL   
ABCDEFGH0010000062  0            THORNT 
ABCDEFGH0010000010  0            WHITTI       N   
ABCDEFGH0010000010  1            WHITTI       Y 


Is this possible using syncsort.

Any help would be greately appriciated.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Aug 11, 2006 2:09 pm    Post subject: Reply with quote

Shreeni,

Run the following job and post the contents of sysout here

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD *
test record
//SORTOUT   DD SYSOUT=*
//SYSIN     DD *
  SORT FIELDS=COPY
/*


This will help to determine the version of syncsort you have

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shreeni
Beginner


Joined: 11 Aug 2006
Posts: 3
Topics: 1

PostPosted: Fri Aug 11, 2006 2:39 pm    Post subject: Syncsort help Reply with quote

Hi kosulu

Syncsort version is :
SYNCSORT FOR Z/OS 1.1CR

Thanks
Sreeni
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Aug 11, 2006 5:32 pm    Post subject: Reply with quote

Shreeni,

Try this untested job.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=your input dataset,
//            DISP=SHR                           
//SORTOUT  DD DSN=&T1,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                           
  OPTION EQUALS                                           
  SORT FIELDS=(28,18,CH,A,                               
               46,01,CH,A)                               
  OUTREC FIELDS=(001,173,                                 
                 C'00000001')                     
/*
//STEP0200 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=&T1,DISP=SHR                             
//SORTOUT  DD DSN=&T2,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE) 
//SORTXSUM DD DSN=&T3,DISP=(,PASS),SPACE=(CYL,(X,Y),RLSE) 
//SYSIN    DD *                                           
  OPTION EQUALS                                           
  SORT FIELDS=(28,18,CH,A)                                 
  SUM FIELDS=(174,8,ZD),XSUM                               
  OUTFIL OUTREC=(01,173,                                   
                 174,8,CHANGE=(8,C'00000001',C'00000000'),
                       NOMATCH=(174,8))                   
/*
//STEP0300 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=&T2,DISP=SHR                         
//         DD DSN=&T3,DISP=SHR                         
//SORTOUT  DD DSN=YOUR OUTPUT DATASET,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//SYSIN    DD *                                         
  OPTION EQUALS                                         
  SORT FIELDS=(28,18,CH,A,                             
               46,01,CH,A)                             
  OUTREC FIELDS=(001,137,                               
                 138:174,8,CHANGE=(1,C'00000000',C' ', 
                                     C'00000001',C'Y'),
                       NOMATCH=(C'N'),                 
                 139,35)                               
/*


Hope this helps....

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Shreeni
Beginner


Joined: 11 Aug 2006
Posts: 3
Topics: 1

PostPosted: Thu Aug 24, 2006 9:53 am    Post subject: Reply with quote

Thanks for your help. It is working.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group