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

convert 20070721 to 2007-07-21


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jm_green84

New User


Joined: 13 Dec 2006
Posts: 11
Location: ATL

PostPosted: Sat Jan 24, 2009 3:38 am
Reply with quote

If I read a date in from a file as $CHAR08. and on the its in 20070721 format. later on how can I get it in 2007-07-21 format?

I tried newdate = input(olddate, yymmdd10.) but it doesn't work.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jan 24, 2009 4:31 am
Reply with quote

This looks like SAS more than DB2. In SAS you need to do:
Code:
NEWDATE = INPUT(OLDDATE,YYMMDD8.) ;
FORMAT NEWDATE YYMMDDD10.;
SAS dates are internally stored as integers, so you merely have to tell it which format to use.
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top