Page 2 of 2

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 8:13 am
by ranga_subham
I tried that but it ends with abend stating that "OUTREC Statement Syntax error" that means overlay is not possible.

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 8:19 am
by ranga_subham
Here it is with error:

 SYSIN :                                                         
   SORT FIELDS=COPY                                               
   OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(58,3,CH,EQ,C'#T#'),           
                  PUSH=(75:1,72)),                               
          IFTHEN=(WHEN=(58,3,CH,EQ,C'#T#'),                       
                  BUILD=(13:84,15,75,4,37:10,62)),               
          IFTHEN=(WHEN=NONE,BUILD=(1:92,2,3:37,2,5:6,6,11:37,2,   
                                   13:84,15,28:1,72)),           
          IFTHEN=(WHEN=(21,1,CH,EQ,C'C'),OVERLAY=(1:C'12'))       
                                        *                         
 WER268A  OUTREC STATEMENT  : SYNTAX ERROR                       
 WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                   


Thanks.

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 8:53 am
by dick scherrer
Hello,

Which release of Syncsort is being used?

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 10:10 am
by ranga_subham
SYNCSORT FOR Z/OS 1.3.2.2R


Thanks.

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 12:10 pm
by BillyBoyo
ranga_subham,

You have to check in your manual what order you are allowed for the different IFTHEN's.

You'll certainly find that WHEN=NONE has to be last.

You are putting data into column one in the WHEN=NONE. I don't understand that bit.

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 3:40 pm
by bodatrinadh
Try this code...

//SYSPRINT DD SYSOUT=*                                               
//SYSOUT DD SYSOUT=*                                     
//SORTIN  DD *                           
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
SRT3     STATUSFL1303404GH6                              #T#
31055ABC0121X6AL5S3 D0      3012052512X226111290N   6AB6922521420
33111XYZ1231Y6AH5S3 D1      3012070312Y2282     N   6AB6922521420
MUT4     STATUSFL1400048MK3                              #T#
74620DEF2134G1J86CC E1      3012090572Z313372650N   1JC4822521243
74620ZEB3218G1J86CC E2      3012090572O313372650N   1JD4822521243
//SORTOUT DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=(58,3,CH,EQ,C'#T#'),
                BUILD=(13:10,15,28:1,4,37:10,18,58:58,3)),
        IFTHEN=(WHEN=(21,1,CH,EQ,C'D'),BUILD=(01:C'13',03:37,2,05:6,6,
                11:37,2,28:1,53)),
        IFTHEN=(WHEN=(21,1,CH,EQ,C'E'),BUILD=(01:C'14',03:37,2,05:6,6,
                11:37,2,28:1,53))
  SORT FIELDS=COPY
 OUTREC IFTHEN=(WHEN=GROUP,BEGIN=(58,3,CH,EQ,C'#T#'),PUSH=(13:13,15)),
        IFTHEN=(WHEN=(58,3,CH,EQ,C'#T#'),OVERLAY=(58:3X))


Your Output :-

----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
            STATUSFL1303404SRT3     STATUSFL1303404GH6
1312ABC01212STATUSFL130340431055ABC0121X6AL5S3 D0      3012052512X226111290N   6
1312XYZ12312STATUSFL130340433111XYZ1231Y6AH5S3 D1      3012070312Y2282     N   6
            STATUSFL1400048MUT4     STATUSFL1400048MK3
1472DEF21372STATUSFL140004874620DEF2134G1J86CC E1      3012090572Z313372650N   1
1472ZEB32172STATUSFL140004874620ZEB3218G1J86CC E2      3012090572O313372650N   1

Re: Syncsort - Copy and Reformat

PostPosted: Wed Sep 12, 2012 7:19 pm
by ranga_subham
Hi,

Thanks.......Yes.......got the results.......... :D