Syncsort numeric processing



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

Re: Syncsort numeric processing

Postby Alissa Margulies » Tue Apr 20, 2010 1:45 am

Please also show us the JCL you submitted.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Syncsort numeric processing

Postby Doug » Tue Apr 20, 2010 9:47 pm

Here are the sort cards I tried to handle the first two amounts

//SYSIN    DD *                                                         
   INREC IFTHEN=(WHEN=INIT,                                             
   PARSE=(%00=(FIXLEN=6),                                               
          %01=(ENDBEFR=C'.',FIXLEN=7),                                 
          %02=(ENDBEFR=C' ',FIXLEN=2),                                 
          %03=(FIXLEN=3),                                               
          %04=(ENDBEFR=C'.',FIXLEN=7),                                 
          %05=(ENDBEFR=C' ',FIXLEN=2))),                               
    IFTHEN=(WHEN=INIT,                                                 
    BUILD=(1:%00,                                                       
           7:%01,JFY=(SHIFT=RIGHT),                                     
           14:C'.',                                                     
           15:%02,JFY=(SHIFT=LEFT),                                     
           17:%03,                                                     
           20:%04,JFY=(SHIFT=RIGHT),                                   
           27:C'.',                                                     
           28:%05,JFY=(SHIFT=LEFT)))                                   
    SORT FIELDS=COPY                                                   
    OUTREC FINDREP=(INOUT=(C' ',C'0'),STARTPOS=7,ENDPOS=16)             



here is the output received -


9     0000000.04        50.93
9     0000618.48  C   AD 0.48
9     0000057.22     CAD 0.22
9V10460000085.58     CAD 0.58
9     0000156.79  C   AD 0.79
9     0000144.48  C   AD 0.48
9     0000202.60   CAD 202.6
9     0000024.71     CAD 0.71
9440210014930.49USD      0.57
97802 0000300.78         1.05



The .04 from the first record shown seems to be coming from a field much further over in the input file. column 249. This looks to be the first decimal point in the record. I did not include the whole input file for simplicity's sake.

There doesn't seem to be a simple way for Syncsort to do this editing. I will probably end up coding my own edit module.

Thanks for trying to help.

Doug
Doug
 
Posts: 8
Joined: Thu Apr 15, 2010 10:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort numeric processing

Postby dick scherrer » Wed Apr 21, 2010 12:36 am

Hello,

If you post a complete set of "realistic" data (not necessarily the actual data, but a representative example) that contains multiple amount fields (say 3) , it can be used to create the control statements. You can then modify this to work with the "real" data. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Syncsort numeric processing

Postby Doug » Wed Apr 21, 2010 6:10 pm

Hi Dick,
I posted data with 3 amount fields on page 1.

Doug
Doug
 
Posts: 8
Joined: Thu Apr 15, 2010 10:40 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Syncsort numeric processing

Postby Alissa Margulies » Wed Apr 21, 2010 10:01 pm

Ok, here is a SyncSort for z/OS 1.3.2 job that will produce the requested output:
//SORT   EXEC PGM=SORT                   
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD *                         
9      0            0               0   
9      618.48   CAD 0               0   
9      57.22    CAD 0               0   
9V1046 85.58    CAD 0               0   
9      156.79   CAD 0               0   
9      144.48   CAD 0               0   
9      202.6    CAD 202.6    PDR    0   
9      24.71    CAD 0               0   
944021 14930.49 USD 0               0   
97802  300      USD 0               0   
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                                                                           
  INREC IFTHEN=(WHEN=INIT,                                             
  BUILD=(1,6,7,10,JFY=(SHIFT=RIGHT),17,3,20,10,JFY=(SHIFT=RIGHT),     
        30,6,36,10,JFY=(SHIFT=RIGHT))),                               
  IFTHEN=(WHEN=(16,1,CH,EQ,C'.'),OVERLAY=(7:9,8,C'00'),HIT=NEXT),     
  IFTHEN=(WHEN=(15,1,CH,EQ,C'.'),OVERLAY=(7:8,9,C'0'),HIT=NEXT),       
  IFTHEN=(WHEN=(14,1,CH,NE,C'.'),OVERLAY=(7:10,7,C'.00'),HIT=NEXT),   
  IFTHEN=(WHEN=(29,1,CH,EQ,C'.'),OVERLAY=(20:22,8,C'00'),HIT=NEXT),   
  IFTHEN=(WHEN=(28,1,CH,EQ,C'.'),OVERLAY=(20:21,9,C'0'),HIT=NEXT),     
  IFTHEN=(WHEN=(27,1,CH,NE,C'.'),OVERLAY=(20:23,7,C'.00'),HIT=NEXT),   
  IFTHEN=(WHEN=(45,1,CH,EQ,C'.'),OVERLAY=(36:38,8,C'00'),HIT=NEXT),   
  IFTHEN=(WHEN=(44,1,CH,EQ,C'.'),OVERLAY=(36:37,9,C'0'),HIT=NEXT),     
  IFTHEN=(WHEN=(43,1,CH,NE,C'.'),OVERLAY=(36:39,7,C'.00'))             
  SORT FIELDS=COPY                                                     
  OUTREC IFTHEN=(WHEN=INIT,                                           
  FINDREP=(INOUT=(C' ',C'0'),STARTPOS=7,ENDPOS=16)),                   
  IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C' ',C'0'),STARTPOS=20,ENDPOS=29)),
  IFTHEN=(WHEN=INIT,FINDREP=(INOUT=(C' ',C'0'),STARTPOS=36,ENDPOS=45))
/*                                                                     

There may be another way of accomplishing this task, but this is what I came up with on the fly. Give it a shot and let us know if you have any questions.

By the way, this is the output that was produced when I submitted the above application:
9     0000000.00   0000000.00      0000000.00
9     0000618.48CAD0000000.00      0000000.00
9     0000057.22CAD0000000.00      0000000.00
9V10460000085.58CAD0000000.00      0000000.00
9     0000156.79CAD0000000.00      0000000.00
9     0000144.48CAD0000000.00      0000000.00
9     0000202.60CAD0000202.60PDR   0000000.00
9     0000024.71CAD0000000.00      0000000.00
9440210014930.49USD0000000.00      0000000.00
97802 0000300.00USD0000000.00      0000000.00
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 3 times

Re: Syncsort numeric processing

Postby Doug » Fri Apr 23, 2010 6:50 pm

Hi Alissa,
Thanks very much !

This worked perfectly.

Doug
Doug
 
Posts: 8
Joined: Thu Apr 15, 2010 10:40 pm
Has thanked: 0 time
Been thanked: 0 time

Previous

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post