Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Date modifications using sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
NeerajPathak26

New User


Joined: 23 Feb 2006
Posts: 2

PostPosted: Thu May 09, 2013 4:30 pm    Post subject: Date modifications using sort
Reply with quote

Hello,
Need help. I am creating a report. I run the report job from Monday to friday.If I run the report job on Monday I need to put the date of friday. If report run day is tuesday to friday I need to put previous day's date. I am getting the cuurent date and weekday as well using OUTREC BUILD=(1:DAYNAME,DATE1(-)). But I am not able to use IFTHEN condition to get the desired result for my requirement.
Appreciate your help on this one.

Thanks
Neeraj
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1530
Location: Andromeda Galaxy

PostPosted: Thu May 09, 2013 4:42 pm    Post subject:
Reply with quote

Dont you have a system to store Business dates?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1530
Location: Andromeda Galaxy

PostPosted: Thu May 09, 2013 5:55 pm    Post subject:
Reply with quote

Also let us know the sort product and version installed in your shop and also please show us the code you have tried within code tags (complete step)
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu May 09, 2013 11:44 pm    Post subject: Re: Date modifications using sort
Reply with quote

NeerajPathak26 wrote:
Hello,
Need help. I am creating a report. I run the report job from Monday to friday.If I run the report job on Monday I need to put the date of friday. If report run day is tuesday to friday I need to put previous day's date. I am getting the cuurent date and weekday as well using OUTREC BUILD=(1:DAYNAME,DATE1(-)). But I am not able to use IFTHEN condition to get the desired result for my requirement.
Appreciate your help on this one.

Thanks
Neeraj


You can use PREVDday function to get last Friday date when the current day is a Monday.

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SYMNAMES DD *                                         
DAYNAME,S'&LWDAY'                                       
//SORTIN   DD *                                         
                                                         
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                         
  OPTION COPY                                           
  INREC IFOUTLEN=80,                                     
  IFTHEN=(WHEN=INIT,OVERLAY=(81:DAYNAME,DATE1-1)),       
  IFTHEN=(WHEN=(81,3,CH,EQ,C'MON'),                     
  OVERLAY=(84,8,Y4T,PREVDFRI,TOGREG=Y4T(-))),           
  IFTHEN=(WHEN=NONE,OVERLAY=(84,4,C'-',88,2,C'-',90,2)) 
//*
Back to top
View user's profile Send private message
NeerajPathak26

New User


Joined: 23 Feb 2006
Posts: 2

PostPosted: Fri May 10, 2013 6:15 pm    Post subject: Reply to: Date modifications using sort
Reply with quote

Thanks SKolusu,
It works.

Regards
Neeraj
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us