return date field as mm/dd/yy

Previous topic - Next topic

jsquizz

Hi All, I have the most simple sql query ever I am writing to a file

select policy, rdate from ada1

as expected, rdate is being returned in the 5 digit date format. Is there any SIMPLE way to do this on the fly, that doesnt require me from writing a stored procedure

What I have:

db2 => select policy, rdate from ada1

POLICY                                             RDATE
-------------------------------------------------- ------
3741474                                            17479

What I want:

What I have:

db2 => select policy, rdate from ada1

POLICY                                             RDATE
-------------------------------------------------- ------
3741474                                            11/08/17

Thanks
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING

Ed_Arnold

#1
I haven't tested this but...

In the latest CMOD Newsletter

http://www-01.ibm.com/support/docview.wss?uid=swg27050682

under z/OS Quick Hits is this:

Using SQL to view old time stamp values
Still running with the old TIME_STAMP and using ARSDATE to convert that to the format of the human-readable time stamp used in TIME_STAMP_DT?
Here's a quick way to view those old stamps in the new format by using SQL:
SELECT TIME_STAMP,
TIMESTAMP('1970-01-01', '00:00:00') + TIME_STAMP SECONDS
FROM hlq.SL2


I hope this helps.

Ed
#zOS #ODF

Justin Derrick

I suspect 'SECONDS' should be 'DAYS' since 17479 is likely to be the number of days since January 1st, 1970.  :)

-JD.
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Webinars:  https://CMOD.Training/
IBM CMOD Professional Services: https://CMOD.cloud

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

jsquizz

yeah i played around with this for a few minutes last night and couldnt get it to work. Will have to mess with more today.
#CMOD #DB2 #AFP2PDF #TSM #AIX #RHEL #AWS #AZURE #GCP #EVERYTHING