Compare the date with current date.



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

Compare the date with current date.

Postby bodhi » Tue Dec 02, 2008 8:17 pm

Hello All,

I have to compare a header date of the file with the current date through JCL.Header date format is YY/MM/DD.Please adivce.I have to do this with JCL ONLY.

Thanks
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare the date with current date.

Postby ranga_subham » Tue Dec 02, 2008 9:10 pm

Hi,

Please show the sample records.

Thanks.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Compare the date with current date.

Postby Alissa Margulies » Tue Dec 02, 2008 10:16 pm

bodhi wrote:I have to compare a header date of the file with the current date

Your request is not clear. What do you want in the output? Please show some sample input and output records.
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: Compare the date with current date.

Postby bodhi » Tue Dec 02, 2008 10:30 pm

Hello,

Let me put my request in this way. I need to compare the header date which is the first record of the dataset to the current date(system date).I want to do this so that always new/current date file processed through the system and if the date is not equal to system date then the job must abend and aviod the processing of wrong file.

The date format is YY/MM/DD.

Thanks
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare the date with current date.

Postby Alissa Margulies » Wed Dec 03, 2008 12:04 am

Assuming the date field is in position 1-8, you can code the following step prior to your job:
//SORT1 EXEC PGM=SORT,PARM='CENTWIN=80,NULLOUT=RC4' 
//SORTIN  DD DSN=INPUT.FILE,DISP=SHR
//SORTOUT DD SYSOUT=*         
//SYSOUT  DD SYSOUT=*                               
//SYSIN   DD *                                       
   INREC FIELDS=(1,2,4,2,7,2)                         
   SORT FIELDS=COPY,STOPAFT=1                         
   OUTFIL INCLUDE=(1,6,Y2T,EQ,Y'DATE1') 
/*

If the header date matches the current system date, you should get RC=0. However, if it does not match, a RC=4 should be produced.

Then you can code COND=(0,NE,SORT1) on the EXEC statement of the following step(s). This instructs the next STEP to only execute if SORT1 got a RC=0. If SORT1 did not get a RC=0, then the following step(s) will be bypassed.
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: Compare the date with current date.

Postby ranga_subham » Wed Dec 03, 2008 3:40 pm

Hi,

I was trying out below code but got "WER251A INCLUDE/OMIT INVALID LENGTH". :shock:

//STEP0001 EXEC PGM=ICEMAN,PARM='CENTWIN=80,NULLOUT=RC4'
//SORTOUT  DD SYSOUT=*                                 
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
20081103                                               
20081203                                               
20081303                                               
20081403                                               
20081503                                               
//SYSIN    DD *                                         
 SORT FIELDS=COPY                                       
 INCLUDE COND=(1,8,Y2T,EQ,Y'DATE1')                     
/*                                                     
//*                                                     


Would you please let me know where I was going wrong :?:

Thank you.
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Compare the date with current date.

Postby ranga_subham » Wed Dec 03, 2008 3:51 pm

Hi,

I got my mistake and corrected the SYSIN to get the results :D

//SYSIN    DD *                   
 SORT FIELDS=COPY                 
 INCLUDE COND=(3,6,Y2T,EQ,Y'DATE1')
/*                                 


Sorry for the confusion 8-)
ranga_subham
 
Posts: 279
Joined: Fri Jul 18, 2008 7:46 pm
Has thanked: 0 time
Been thanked: 1 time

Re: Compare the date with current date.

Postby Alissa Margulies » Thu Dec 04, 2008 1:12 am

Thanks for letting us know you were able to resolve the issue.
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: Compare the date with current date.

Postby bodhi » Fri Dec 05, 2008 11:38 pm

Hi Alissa,

Thank you for the help. This is exactly the same which i am looking for.One more request could you please let me know is there is any onlin book from where i can brush up my knowledge on SORT utility.

Thank you
Bodhi
bodhi
 
Posts: 52
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Compare the date with current date.

Postby Alissa Margulies » Sat Dec 06, 2008 12:31 am

Bodhi,

Contact me offline at alissa.margulies@syncsort.com or send me a private message. You will just need to provide me with your SyncSort license information (company name, CPU serial number, and corporate email address) and I can send you a pdf version of the manuals.
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


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post