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

Resize ( sort of ) for SYNCSORT


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
madmartinsonxx

New User


Joined: 10 Dec 2010
Posts: 96
Location: Massachusetts

PostPosted: Sat Feb 16, 2013 2:06 am
Reply with quote

Code:

//REPEAT EXEC PGM=SYNCSORT                       
//SYSOUT  DD SYSOUT=*                           
//RPTSQ   DD SYSOUT=*                           
//SORTOUT DD SYSOUT=*                           
//SORTIN  DD *                                   
 NOTTA                                           
/*                                               
//SYSIN     DD *                                 
  SORT FIELDS=COPY                               
  OUTFIL FNAMES=RPTSQ,                           
    OVERLAY=(01:C'01,02,A_SPACE,25,09,A_SPACE,',
      SEQNUM,8,ZD,START=0110,INCR=030,C',30,/,'),
        REPEAT=10                               
/*                                               
//* END OF BUILD                                 
//                                               


this shop is a syncsort shop and i found out the hard way. After trying to use RESIZE and getting frustrated I thought there must be a way around it. The records I had to break down had an OCCURS Clause of 50. I was typing away trying to get the exact byte count and place it into my build and I was making a lot of mistakes. I ended up researching this wonderful forum and found my way to SEQNUM and REPEAT=.
This worked great after getting the syntax errors debugged.
I finally got my cards output to where I can drag them into my next go around with COBOL Occurs.
they look like this...

Code:

01,02,A_SPACE,25,09,A_SPACE,00000110,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000140,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000170,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000200,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000230,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000260,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000290,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000320,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000350,30,/,
01,02,A_SPACE,25,09,A_SPACE,00000380,30,/,


Hope this helps somebody who is facing what I am every day. Cheers.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Feb 16, 2013 3:11 pm
Reply with quote

Thanks madmartinsoxx, already suggested it to someone (they may not look at it).

Here's my take on it, with symbols/SYMNAMES:

Code:
IN-RECORD-AREA,1,409,CH
IN-RA-ID,=,2,CH            # = GETS START OF PREVIOUS FIELD
  SKIP,22                  # LIKE A FILLER
IN-RA-ACCOUNT,*,9,CH
  SKIP,76                  # LIKE A FILLER
IN-RA-OCCURS01,*,30,CH     # * GETS FIRST POSITION AFTER PREVIOUS FIELD
IN-RA-OCCURS02,*,30,CH
IN-RA-OCCURS03,*,30,CH
IN-RA-OCCURS04,*,30,CH
IN-RA-OCCURS05,*,30,CH
IN-RA-OCCURS06,*,30,CH
IN-RA-OCCURS07,*,30,CH
IN-RA-OCCURS08,*,30,CH
IN-RA-OCCURS09,*,30,CH
IN-RA-OCCURS10,*,30,CH


Code:
   SORT FIELDS=COPY,STOPAFT=1
   OUTFIL FNAMES=RPTSQ,
     OVERLAY=(01:80X,03:C'IN-RA-ID,X,IN-RA-ACCOUNT,X,',
       C'IN-RA-OCCURS',SEQNUM,2,ZD,START=1,INCR=1,C',/,'),
         REPEAT=10


Gets you

Code:
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS01,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS02,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS03,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS04,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS05,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS06,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS07,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS08,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS09,/,
  IN-RA-ID,X,IN-RA-ACCOUNT,X,IN-RA-OCCURS10,/,


Once you've got the symbols, for 10 it is easy enough with the editor, but for 100 can help.

You could also look at generating symbols from a "stub" Cobol program containing the record-layout in question. Then no calculations at all.
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 -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top