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 

trailer count reformatting using SYNCSORT

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


Joined: 28 Feb 2006
Posts: 7
Topics: 3

PostPosted: Thu Mar 09, 2006 8:29 pm    Post subject: trailer count reformatting using SYNCSORT Reply with quote

Hi,

I have a file (VB 80)with the following structure

1XXXXX
2YYYYYYYYYYY
3ZZZZZZZZ1234567
1XXXXX
2YYYYYYYYYYY
3ZZZZZZZZ1234567

Pos 1 - record type ( 1 - Hdr, 2-Dtl, 3 - Trl)

The value 1234567 in the trailer record is a 9(7) field having the count of records. This is the last field on the trailer record. rest is filler.
I need to increase the size of the trailer count field from 9(7) to 9(13).
Need a syncsort to which would read this file and update the trailer count to reflect the new size of the field

The output should look like

1XXXXX
2YYYYYYYYYYY
3ZZZZZZZZ0000001234567
1XXXXX
2YYYYYYYYYYY
3ZZZZZZZZ0000001234567
Back to top
View user's profile Send private message
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Thu Mar 09, 2006 11:33 pm    Post subject: Reply with quote

Using, DFSORT the solution is relatively easy Smile

Code:

//TEST01     EXEC PGM=SORT
//*
//SORTIN     DD DSN=JAYA.TEST.VBIN,DISP=SHR           
//*                                                       
//SORTOUT    DD DSN=JAYA.TEST.VBOUT,               
//              DISP=(NEW,CATLG,DELETE),                     
//              UNIT=SYSDA,                                 
//              SPACE=(TRK,(250,50),RLSE)                 
//SYSOUT     DD SYSOUT=*                               
//SYSIN      DD *
 OPTION COPY                                                     
 OUTREC IFTHEN=(WHEN=(5,1,CH,EQ,C'3'),                           
                OVERLAY=(14:14,7,ZD,EDIT=(TTTTTTTTTTTTT)))       
/*



Output:

Code:
----+----1----+----2----+----3----+----4----+----5
********************************* Top of Data ****
1XXXXX                                           
2YYYYYYYYYYY                                     
3ZZZZZZZZ0000001234567                           
1XXXXX                                           
2YYYYYYYYYYY                                     
3ZZZZZZZZ0000001234567                           


Thanks,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
Back to top
View user's profile Send private message
rintu
Beginner


Joined: 28 Feb 2006
Posts: 7
Topics: 3

PostPosted: Sat Mar 11, 2006 10:44 am    Post subject: Reply with quote

We don't have DFSORT....does this work with SYNCSORT
Back to top
View user's profile Send private message
Jaya
Beginner


Joined: 02 Sep 2005
Posts: 77
Topics: 10
Location: Cincinnati

PostPosted: Mon Mar 13, 2006 2:04 am    Post subject: Reply with quote

Rintu,

Please try this SYNCTOOL solution to reformat and create 80 byte output VB file.

Code:
//S1        EXEC  PGM=SYNCTOOL                                       
//TOOLMSG   DD  SYSOUT=*                                             
//DFSMSG    DD  SYSOUT=*                                             
//IN        DD DSN=JAYA.TEST.VB,DISP=OLD                       
//T1        DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//T2        DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)   
//CON       DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)                 
//          DD DSN=*.T2,VOL=REF=*.T2,DISP=(OLD,PASS)                 
//OUT       DD DSN=JAYA.TEST.VB.OUT,                                 
//            DISP=(NEW,CATLG,DELETE),                               
//            UNIT=SYSDA,SPACE=(TRK,(500,100),RLSE),                 
//            DCB=(RECFM=VB,LRECL=80,BLKSIZE=0)                     
//TOOLIN    DD *                                                     
COPY FROM(IN) USING(CTL1)                                           
SORT FROM(CON) USING(CTL2)                                           
/*                                                                   
//CTL1CNTL  DD *                                                     
  OPTION COPY                                                       
  INREC  FIELDS=(1,4,5:SEQNUM,8,ZD,13:5)                             
  OUTFIL FNAMES=T1,INCLUDE=(13,1,SS,EQ,C'1,2')                       
  OUTFIL FNAMES=T2,SAVE,                                         
         OUTREC=(1,4,5,17,22,7,ZD,EDIT=(TTTTTTTTTTTTT),29)       
/*                                                               
//CTL2CNTL  DD *                                                 
 OPTION VLLONG                                                   
 SORT FIELDS=(5,8,ZD,A)                                           
 OUTFIL FNAMES=OUT,OUTREC=(1,4,13),VLTRIM=X'40'                   
/*                                                               
//           


Note: Option VLLONG will truncate any record exceeding the MAX LRECL set to 80 bytes in the output file.

Output:

Code:
----+----1----+----2----+----3----+----4-
********************************* Top of
1XXXXX                                   
2YYYYYYYYYYY                             
3ZZZZZZZZ0000001234567                   
1XXXXX                                   
2YYYYYYYYYYY                             
3ZZZZZZZZ0000001234567                   


Thanks,
Jaya.
_________________
"Great spirits have always encountered violent opposition from mediocre minds."
-Albert Einstein
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