Date Manipulation through Syncsort

Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL
puspojit
Posts: 3
Joined: Mon May 05, 2008 2:51 pm
Skillset: CICS,VSAM,COBOL,DB2
Referer: Reference

Date Manipulation through Syncsort

Postby puspojit » Mon May 05, 2008 3:29 pm

Hi,

I have a file which has a field containing values ranging from (1-7).
Depending on these values I have to Overlay(Overwrite) that field in the O/P file with (SYSDATE-n) where n is the value of that field in the I/P file.
Please let me know whether this can be achieved through Synsort and if yes,do let me know the sort card.

Syncsort version used is

Code: Select all

SYNCSORT FOR Z/OS  1.2.2.2R


Thanks and Regards,
Puspojit

arunprasad.k
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Skillset: Known little stuffs to answer a few queries!!
Referer: Google
Contact:

Re: Date Manipulation through Syncsort

Postby arunprasad.k » Mon May 05, 2008 7:18 pm

Puspojit,

Some sample I/P records and the corresponding expected O/P will help those who likes to help you.

Also what is SYSDATE? Is it a constant or it refers system date?

Arun.

arunprasad.k
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Skillset: Known little stuffs to answer a few queries!!
Referer: Google
Contact:

Re: Date Manipulation through Syncsort

Postby arunprasad.k » Mon May 05, 2008 7:49 pm

Okay I got the requirement.

I do not have syncsort in my shop. May be you can try this JCL which works with DFSORT. :(

The O/P will have the date in the format CCYY-MM-DD.

Code: Select all

//S01   EXEC PGM=SORT                                                   
//SYSOUT  DD SYSOUT=*                                                   
//SORTIN  DD *                                                         
1                                                                       
2                                                                       
3                                                                       
/*                                                                     
//SORTOUT DD SYSOUT=*                                                   
//SYSIN   DD *                                                         
  SORT FIELDS=COPY                                                     
  OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),                                 
            OVERLAY=(1:DATE1(-)-1)),                                   
         IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),                                 
            OVERLAY=(1:DATE1(-)-2)),                                   
         IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),                                 
            OVERLAY=(1:DATE1(-)-3))                                     
/*                                                                     


Continue for all the values of n. I just gave 1 to 3.

Arun.

puspojit
Posts: 3
Joined: Mon May 05, 2008 2:51 pm
Skillset: CICS,VSAM,COBOL,DB2
Referer: Reference

Re: Date Manipulation through Syncsort

Postby puspojit » Mon May 05, 2008 9:15 pm

Hi Arun,

Sysdate is system date.
Anyways, I do not have DFSORT over here...so posted my query in Syncsort forum.
Your sort card wont work over here for Obviuos reasons. Anyways, does date functions which you have mentioned over
here work with sync sort....Any one having any ideas?

Regards,
Puspojit

Alissa Margulies
Global moderator
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Skillset: Syncsort MFX for z/OS
Referer: Dick Scherrer
Location: USA
Contact:

Re: Date Manipulation through Syncsort

Postby Alissa Margulies » Mon May 12, 2008 9:10 pm

Puspojit,

Arun's job should work in your shop as well with SyncSort for z/OS. If it does not, then please post the error message that you get.

Good Luck,
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com

ranga_subham
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Skillset: JCL,COBOL,DB2,IMS/DB,CICS,VSAM
Referer: I was banned by superk in main forum so I am here

Re: Date Manipulation through Syncsort

Postby ranga_subham » Thu Oct 23, 2008 9:41 pm

Alissa, I was going through the old posts and thought to give this a try.... :)

The job failed at our site.

Code: Select all

SYSIN :                                       
  SORT FIELDS=COPY                           
  OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),       
            OVERLAY=(1:DATE1(-)-1)),         
                               *             
         IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),       
            OVERLAY=(1:DATE1(-)-2)),         
         IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),       
            OVERLAY=(1:DATE1(-)-3))           
WER268A  OUTREC STATEMENT  : SYNTAX ERROR     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Thanks.

Alissa Margulies
Global moderator
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Skillset: Syncsort MFX for z/OS
Referer: Dick Scherrer
Location: USA
Contact:

Re: Date Manipulation through Syncsort

Postby Alissa Margulies » Fri Oct 24, 2008 12:00 am

Which release and maintenance level of SyncSort are you running?
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com

ranga_subham
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Skillset: JCL,COBOL,DB2,IMS/DB,CICS,VSAM
Referer: I was banned by superk in main forum so I am here

Re: Date Manipulation through Syncsort

Postby ranga_subham » Fri Oct 24, 2008 9:18 am

We are using SYNCSORT FOR Z/OS 1.2.3.1R

Alissa Margulies
Global moderator
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Skillset: Syncsort MFX for z/OS
Referer: Dick Scherrer
Location: USA
Contact:

Re: Date Manipulation through Syncsort

Postby Alissa Margulies » Wed Oct 29, 2008 1:50 am

Change all your DATE1 to &DATE1 (the character preceding DATE1 is an ampersand) and see if that corrects the syntax error.
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com

ranga_subham
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Skillset: JCL,COBOL,DB2,IMS/DB,CICS,VSAM
Referer: I was banned by superk in main forum so I am here

Re: Date Manipulation through Syncsort

Postby ranga_subham » Wed Oct 29, 2008 8:21 pm

Below is the changed code per your suggestion but still fails........... :|

Code: Select all

SYSIN :                                     
 SORT FIELDS=COPY                           
 OUTREC IFTHEN=(WHEN=(1,1,CH,EQ,C'1'),       
           OVERLAY=(1:&DATE1(-)-1)),         
                               *             
        IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),       
           OVERLAY=(1:&DATE1(-)-2)),         
        IFTHEN=(WHEN=(1,1,CH,EQ,C'3'),       
           OVERLAY=(1:&DATE1(-)-3))         
WER268A  OUTREC STATEMENT  : SYNTAX ERROR   
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE


Thanks.


  • Similar Topics
    Replies
    Views
    Last post