Page 1 of 1

Date Manipulation

PostPosted: Tue Mar 27, 2012 9:57 pm
by ibmmf4u
Hi,

Can someone provide me the sort card to subtract one day from the date field which is in mmddyy format from the input file and write it to an output file

For Ex:-

Input file:-

032612
032712



The expected output file:-

Output file:-

032512
032612

Re: Date Manipulation

PostPosted: Tue Mar 27, 2012 10:34 pm
by Alissa Margulies
Hello ibmmf4u.

Here is a Syncsort MFX for z/OS 1.4 solution:

//STEP1 EXEC PGM=SORT,PARM='CENTWIN=80'     
//SORTIN  DD *                             
032612                                     
032712                                     
//SORTOUT DD SYSOUT=*                       
//SYSOUT  DD SYSOUT=*                       
//SYSIN   DD *                             
  SORT FIELDS=COPY   
  OUTREC FIELDS=(DATEADD=(1,6,DTNS,-1,DAY)) 
/*                                         

Re: Date Manipulation

PostPosted: Tue Mar 27, 2012 10:55 pm
by ibmmf4u
Hi Alissa,

Thanks for the quick reply. we are currently using Z/OS 1.3.2.2R in our shop.

I tried the above code, it gave me an error.

Is it possible to achieve the same in 1.3.2.2R version??If not can you provide me any alternate solution.

Thanks in advance!!

Re: Date Manipulation

PostPosted: Tue Mar 27, 2012 11:07 pm
by ibmmf4u
Hi Alissa,

Pasted below is the error message which i encounter while executing the above program!!

SYNCSORT FOR Z/OS  1.3.2.2R       
           
SYSIN :                                                                 
  SORT FIELDS=COPY                                                     
    OUTREC FIELDS=(DATEADD=(1,6,DTNS,-1,DAY))                           
                   *                                                   
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                               
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                           
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                           


Please help me out!!

Re: Date Manipulation

PostPosted: Tue Mar 27, 2012 11:18 pm
by Alissa Margulies
Date arithmetic is not supported in SyncSort for z/OS 1.3. That is why you are receiving the syntax error. You must upgrade to release 1.4 to avoid this error.

Regards,