Date conversion from mmddyyyy format to ccyymmdd



IBM's flagship relational database management system

Date conversion from mmddyyyy format to ccyymmdd

Postby manonmani » Wed Oct 26, 2016 11:33 am

Hi , kindly help me in urgent.
I have an requirement wherein,
1) A input PS file contain date in the format ddmmyyyy.

2) Use date input file and create db2 query in output file. the qry should look like select timestamp('CCYY-MM-DD.01.01.000001') - 1 months from sysibm.sysdummy1;

2) Run the db2 query present in file created in setp1

3) use the output file created in step2 in DB2 reorg application to clean table (Reorg with discard option)
manonmani
 
Posts: 2
Joined: Thu Oct 20, 2016 7:22 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby enrico-sorichetti » Wed Oct 26, 2016 1:05 pm

thank You for telling us what You have to do...
unfortunately You did not ask any question

Hi , kindly help me in urgent.


You should remember that people answer ...

on their own time
free of charge

based on ...
interest of the question
benevolence factor of the TS
knowledge about the topic being discussed

there is no commitment to give an answer
there should be no expectation to get one

also
claiming urgency will lower Your benevolence factor ( the willingness of people to help )

if You have time constraint a forum is not the best place to ask for help
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby NicC » Wed Oct 26, 2016 1:32 pm

Also, what has this to do with JCL? It would appear to be a DB2 question. Moving to DB2. And I am prettry sure that there is a SUBSTR function within DB2 which could help you re-arrange the values as you want.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby enrico-sorichetti » Wed Oct 26, 2016 1:43 pm

apart the mud
looks like there is no need to bother DB2 for step 2 - a simple sort might be enough
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby manonmani » Wed Oct 26, 2016 3:09 pm

Thanks for the input . im a very beginner so asked and the word urgent , I meant in the context for help .
I was trying to ask any date conversion functions available.
manonmani
 
Posts: 2
Joined: Thu Oct 20, 2016 7:22 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby NicC » Wed Oct 26, 2016 3:45 pm

any date conversion functions available

Yes - many but at what point in your process? You are generatinng a query using your own program? Use the facilities provided by the programming language used. Using your sort product? Split the field and rebuild in the correct format when creating the output record - plenty of examples around.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Date conversion from mmddyyyy format to ccyymmdd

Postby enrico-sorichetti » Wed Oct 26, 2016 5:56 pm

when the task is to reformat input records , adding/removing fields
it is always wise to post an accurate sample of the input record
and the same for the output records.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post