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
 

 

Incrementing the date in each record

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

New User


Joined: 20 Aug 2006
Posts: 34
Location: chennai

PostPosted: Fri Nov 23, 2012 12:03 am    Post subject: Incrementing the date in each record
Reply with quote

Hi ,

I want to increment the date in each record . for example

input:
2011-12-29
2011-12-30
2011-12-31

Output should be:
2011-12-30
2011-12-31
2012-01-01

I tried using ADDDAYS function , but this increments by a constant in each record. Please let me know if anybody has any idea.
Back to top
View user's profile Send private message

Pandora-Box

Moderator


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

PostPosted: Fri Nov 23, 2012 12:49 am    Post subject:
Reply with quote

Try DATE1+1
Back to top
View user's profile Send private message
shaktiprasad

New User


Joined: 20 Aug 2006
Posts: 34
Location: chennai

PostPosted: Fri Nov 23, 2012 1:04 am    Post subject: Reply to: Incrementing the date in each record
Reply with quote

Hi Pandora-Box,

Thanks for the reply . I think I posted it wrong for the input. correct input is as below:
2011-12-29
2011-12-29
2011-12-29

Output should be:
2011-12-30
2011-12-31
2012-01-01

will this DATE1+1 Work?
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Nov 23, 2012 1:30 am    Post subject: Reply to: Incrementing the date in each record
Reply with quote

Quote:
will this DATE1+1 Work?


wouldn' t be faster to test than ask ? icon_cool.gif
Back to top
View user's profile Send private message
shaktiprasad

New User


Joined: 20 Aug 2006
Posts: 34
Location: chennai

PostPosted: Fri Nov 23, 2012 1:32 am    Post subject: Reply to: Incrementing the date in each record
Reply with quote

Well I just tested and it isn't working
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 23, 2012 2:07 am    Post subject:
Reply with quote

Quote:
I tried using ADDDAYS function , but this increments by a constant in each record.


that is only partially true.
you can add a constant,
or as this link shows you can also reference a field within the records (p,m,f)

take a moment and scroll down to:
Quote:
numeric can be a decimal constant (+n or -n), or a valid numeric field
| (p,m,f) with BI, FI, ZD, PD, FS, UFF or SFF format and an
| appropriately corresponding length


and since you are obviously technically (and personally)challenged
maybe overlay a seqnum to each record during INREC
and then do the ADDDAYS during OUTREC as well as dropping the sequence number.

Quote:
Well I just tested and it isn't working

and if i find in the future a post by yours that is so
basically juvenile
you will become the receiver of one of my infamous flames.
people are trying to help you,
and not only can you not describe your requirements properly,
you think that you can be cute with your answers.

i look forward to future topics started by you.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Nov 23, 2012 2:39 am    Post subject: Reply to: Incrementing the date in each record
Reply with quote

well, Dick, what do You expect from somebody who in his profile has ...

Quote:
Occupation: Designer
Mainframe Skills: PLAYING CRICKET ,TT,READING NEWS PAPERS
Back to top
View user's profile Send private message
shaktiprasad

New User


Joined: 20 Aug 2006
Posts: 34
Location: chennai

PostPosted: Fri Nov 23, 2012 3:05 am    Post subject: Reply to: Incrementing the date in each record
Reply with quote

My objective was to increment date by 1 day in 1st record , then 2 day in 2nd and so on. This was to create a update query later on. I think I clearly mentioned that in my post.

I tried adding a seqnum after date field and based on seqnum field , I could able to create a update query with date +<seqnum> days. This solved my problem.
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 TOT & DATE parameter in ICEMAN hemanthj642 DFSORT/ICETOOL 4 Mon Nov 14, 2016 5:19 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
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
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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