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

Incrementing the date in each record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Nov 23, 2012 12:49 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 23, 2012 1:30 am
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
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Nov 23, 2012 2:39 am
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
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 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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
Search our Forums:

Back to Top