Page 2 of 2

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Tue Sep 23, 2014 5:06 pm
by BillyBoyo
I don't have access to SyncSORT. I don't understand why you get a message for OUTREC when you are not using OUTREC.

The INCLUDE= should be for for, not less than or equal to four.

Why is the LRECL so large? Why do you want to output fixed-length-variable-length record in the end?

Change the BUILD on OUTFIL to (1,4,5,76) for now, to see if it shows a record.

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Tue Sep 23, 2014 5:30 pm
by BillyBoyo
I've made an example using fixed-length records (until those questions are answered)

//HARRYF   EXEC PGM=SORT
//CHKOUT DD DUMMY
//SYSOUT   DD SYSOUT=*
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=GROUP,
                  BEGIN=(1,1,CH,EQ,C'1'),
                  PUSH=(30:2,28),
                  RECORDS=4),
        IFTHEN=(WHEN=GROUP,
                  BEGIN=(1,1,CH,EQ,C'2'),
                  PUSH=(59:2,18),
                  RECORDS=3),
        IFTHEN=(WHEN=GROUP,
                  BEGIN=(1,1,CH,EQ,C'3'),
                  PUSH=(78:2,18),
                  RECORDS=2)
                                                           
  OUTFIL INCLUDE=(1,1,CH,EQ,C'4'),
         IFTHEN=(WHEN=INIT,
                   BUILD=(30,66,X,2,13)),
         IFTHEN=(WHEN=INIT,
                   OVERLAY=(1,80,SQZ=(SHIFT=LEFT,MID=C',')))
//SORTIN   DD *
1TRL,V05,00,201409,20140831,
2   000000000446967
3   000000000002788
4000071355053

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Tue Sep 23, 2014 6:44 pm
by hariharan_bk
ok BillyBoyo.

I have also changed the input to FB from VB.

i need to reformat the FB 80 byte record to satisfy my additional requirement. Following is the sysntax i used.

OUTREC BUILD=(1:1,27,28:C'000',31:28,16,47:C'000',50,44,16,   
       66:C' ',67:C'00000',72:60,12,84:C',+',80:X)             


following is the error we are getting, can u help -
SYNCSORT LICENSED FOR VERIZON WIRELESS                           
SYSIN :                                                           
   OPTION COPY                                                   
   OUTREC BUILD=(1:1,27,28:C'000',31:28,16,47:C'000',50,44,16,   
          66:C' ',67:C'00000',72:60,12,84:C',+',90:X)             
            *                                                     
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                         
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
******************************* BOTTOM OF DATA *******************


input file : FB 80 byte

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
TRL,V05,00,201409,20140831,,000000000446967,000000000002788,000071355053       
******************************** Bottom of Data ********************************


output expected: FB, 90 byte

TRL,V05,00,201409,20140831,000000000000446967,000000000000002788, 00000000071355053,+

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Tue Sep 23, 2014 7:04 pm
by hariharan_bk
Found the issue. We will resolve this. Thanks

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Thu Sep 25, 2014 12:02 am
by hariharan_bk
Hi BillyBoyo or team,

can u help me fix the above issue for VB records. currently the approach is working fine for FB.

It wud be of great help with VB

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Thu Sep 25, 2014 1:36 am
by BillyBoyo
Can you post what you have the the FB, please? You'll also need to answer those questions I asked earlier.

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Thu Sep 25, 2014 10:38 pm
by Thampy
I tried the below syncsort jcl assuming the record length of 80 and VB record format for all the input files. The merge works fine.

//STEP001 EXEC PGM=SORT                       
//SYSOUT   DD  SYSOUT=*                       
//SORTIN DD DSN=VBFILE1,DISP=SHR                             
//       DD DSN=VBFILE3,DISP=SHR                             
//       DD DSN=VBFILE2,DISP=SHR                             
//       DD DSN=VBFILE4,DISP=SHR                             
//SORTOUT  DD DSN=VBFILE5,DISP=(,CATLG,DELETE),             
//         SPACE=(TRK,(3,1),RLSE),RECFM=VB,LRECL=320,DSORG=PS       
//SYSIN    DD  *                                                     
  SORT FIELDS=(92,1,CH,A)                                           
  SUM FIELDS=(32,8,40,8,48,2,51,8,59,8,67,2,70,8,78,4),FORMAT=BI     
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(32:18Z,                           
                51:18Z,70:12Z,90:SEQNUM,2,ZD,92:C'A')),             
        IFTHEN=(WHEN=(90,2,ZD,EQ,2),OVERLAY=(32:5,18)),             
        IFTHEN=(WHEN=(90,2,ZD,EQ,3),OVERLAY=(51:5,18)),             
        IFTHEN=(WHEN=(90,2,ZD,EQ,4),OVERLAY=(70:5,12))               
  OUTREC BUILD=(1,31,32,51,SQZ=(SHIFT=LEFT,MID=C','))               


Output is

TRL,V05,00,201409,20140831,000000000446967,000000000002788,000071355053

Re: merge 4 VB records from 4 differnt files into single VB

PostPosted: Fri Sep 26, 2014 12:12 am
by BillyBoyo
You should specify OPTION EQUALS and be aware that this won't work if there are other than numeric data on the other three files, or if someone decides to cut the leading zeros off so that you have variable-length fields.

You'll have trailing blanks on your record. You shouldn't specify DCB information for output files, SORT will handle that.