Assign same sequence number for set of records.



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

Assign same sequence number for set of records.

Postby ranga_subham » Thu Jul 30, 2009 5:36 pm

Hi,

My input file (LRECL=80, RECFM=FB) contains sets of records and I need to assign 6 digit sequence number for each set of records. Each set of records start with '01' and ends with '99' type in column 1 (2 byte field). Each set of record can be distinguished by looking at column 6 (10 bytes length) of input record. The output file should be LRECL=80 and RECFM=FB. We are using "SYNCSORT FOR Z/OS 1.2.3.1R".

Input:
----+----+----+----+
01755    BZX755
02755    BZX755
06755    BZX755
06755    BZX755
06755    BZX755
06755    BZX755
07755    BZX755
08755    BZX755
09755    BZX755
99755    BZX755
01756    BZY756
02756    BZY756
06756    BZY756
06756    BZY756
06756    BZY756
06756    BZY756
07756    BZY756
08756    BZY756
09756    BZY756
99756    BZY756
01757    BZA757
02757    BZA757
06757    BZA757
06757    BZA757
06757    BZA757
06757    BZA757
07757    BZA757
08757    BZA757
09757    BZA757
99757    BZA757


Desired output:
----+----+----+----+----+----+
00000101755    BZX755
00000102755    BZX755
00000106755    BZX755
00000106755    BZX755
00000106755    BZX755
00000106755    BZX755
00000107755    BZX755
00000108755    BZX755
00000109755    BZX755
00000199755    BZX755
00000201756    BZY756
00000202756    BZY756
00000206756    BZY756
00000206756    BZY756
00000206756    BZY756
00000206756    BZY756
00000207756    BZY756
00000208756    BZY756
00000209756    BZY756
00000299756    BZY756
00000301757    BZA757
00000302757    BZA757
00000306757    BZA757
00000306757    BZA757
00000306757    BZA757
00000306757    BZA757
00000307757    BZA757
00000308757    BZA757
00000309757    BZA757
00000399757    BZA757


Please help.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Assign same sequence number for set of records.

 

Re: Assign same sequence number for set of records.

Postby arcvns » Thu Aug 06, 2009 5:01 am

Hello,

This is untested. But you can give this a try. I have assumed an output LRECL of 86.

//STEP1  EXEC PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN= Input  file (FB/80)                           
//SORTOUT  DD DSN= Output file (FB/86)
//SYSIN    DD *                                                     
  OPTION COPY                                                       
  INREC IFTHEN=(WHEN=INIT,BUILD=(SEQNUM,6,ZD,1,80)),                 
        IFTHEN=(WHEN=(7,2,CH,EQ,C'01'),                             
        OVERLAY=(1:SEQNUM,6,ZD)),                                   
        IFTHEN=(WHEN=NONE,                                           
        OVERLAY=(87:SEQNUM,6,ZD,01:01,6,ZD,SUB,87,6,ZD,M11,LENGTH=6))
  OUTREC BUILD=(1,86)
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: Assign same sequence number for set of records.

Postby ranga_subham » Thu Aug 06, 2009 3:27 pm

Thank you.....I will try it.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Assign same sequence number for set of records.

Postby arcvns » Fri Aug 07, 2009 10:48 am

You're welcome. Good luck.
Arun
User avatar
arcvns
 
Posts: 55
Joined: Sat Feb 28, 2009 12:36 am
Location: India
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post