Date Manipulation through Syncsort



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

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
SYNCSORT FOR Z/OS  1.2.2.2R


Thanks and Regards,
Puspojit
puspojit
 
Posts: 3
Joined: Mon May 05, 2008 2:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Date Manipulation through Syncsort

 

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
Has thanked: 0 time
Been thanked: 0 time

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.

//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.
arunprasad.k
 
Posts: 110
Joined: Thu Dec 27, 2007 5:18 pm
Has thanked: 0 time
Been thanked: 0 time

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
puspojit
 
Posts: 3
Joined: Mon May 05, 2008 2:51 pm
Has thanked: 0 time
Been thanked: 0 time

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
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

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.

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.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

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
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

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
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

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
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

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........... :|

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.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Next

Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post