IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to get the Prvious day's Date


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rchatu214

New User


Joined: 10 Dec 2006
Posts: 5
Location: hyderabad

PostPosted: Thu Jul 17, 2008 6:32 pm
Reply with quote

I have requirement like this.
I have one input file in which one of the field is a date which will be blank initially.But after sorting on another filed, this date field should be updated by previous day's date in the output file. Can any one help on this.

Thanks in advance.
rama
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Thu Jul 17, 2008 6:46 pm
Reply with quote

You can use this logic to get the prev day's date.
Note: In my test file i had the sample data for the first 20 bytes.

Code:

  OPTION COPY                           
  INREC OVERLAY=(1,20,DATE1)           
  OUTREC BUILD=(1,20,(21,8,ZD,SUB,+1)) 
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jul 17, 2008 9:24 pm
Reply with quote

Manu,

Please update your knowledge of DFSORT before answering questions on it. DFSORT has had the ability to compute relative dates since April, 2006.

DATE1-1 will give yesterdays date in 'yyyymmdd' form. Other variations will give relative dates in other forms.

Rama,

For more information on using relative dates with DFSORT, see:

www.ibm.com/systems/support/storage/software/sort/mvs/peug/
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Thu Jul 17, 2008 9:35 pm
Reply with quote

Thanks Frank. I initially tried DATE1P-1 and it didn't work. Should have tried with DATE1-1. My bad. I generally don't respond to DFSORT queries but was so tempted with this one. My apologies.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Thu Jul 17, 2008 9:42 pm
Reply with quote

Also Frank i have SYNCSORT 1.2.3.1R installed in my shop which doesn't
support DATE1-1 and hence the confusion. Sorry again.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jul 17, 2008 9:43 pm
Reply with quote

Quote:
I initially tried DATE1P-1 and it didn't work.


Didn't work how? DFSORT supports DATE1P-1 - it gives yesterdays date in P'yyyymmdd' form.
Back to top
View user's profile Send private message
Manuneedhi K

Active User


Joined: 07 May 2008
Posts: 115
Location: Chennai

PostPosted: Thu Jul 17, 2008 9:50 pm
Reply with quote

Frank,

I have clarified that in the second post. We don't have DFSORT here , we run SYNCSORT icon_sad.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Jul 17, 2008 10:15 pm
Reply with quote

Since you use Syncsort, please consider not posting in the DFSORT Forum to avoid confusion.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
No new posts Fetch data from programs execute (dat... DB2 3
Search our Forums:

Back to Top