Page 1 of 1

Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 11:33 am
by manonmani
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)

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 1:05 pm
by enrico-sorichetti
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

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 1:32 pm
by NicC
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.

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 1:43 pm
by enrico-sorichetti
apart the mud
looks like there is no need to bother DB2 for step 2 - a simple sort might be enough

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 3:09 pm
by manonmani
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.

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 3:45 pm
by NicC
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.

Re: Date conversion from mmddyyyy format to ccyymmdd

PostPosted: Wed Oct 26, 2016 5:56 pm
by enrico-sorichetti
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.