BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Rixile106
Fluorite | Level 6
DATA want;
SET have ;

	FORMAT Open_Dt DATE9.;
 Open_Dt= PUT (TAKE_UP_DATE_CD,YYMMDD10.) ;
RENAME DIFF =DIFF_AMT ;

RUN 

can you please assist in converting this a numberic value to date format 

expected outcome 

 

 

Rixile106_0-1693311393703.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Numbers like this look like dates to human, but are not dates to SAS. The conversion is

 

newdate=input(put(date,8.),yymmdd8.);
format new_date date9.;
--
Paige Miller

View solution in original post

6 REPLIES 6
Astounding
PROC Star

What is the name of the variable that you wish to convert?

 

Give a few examples of the values that it currently has.

Rixile106
Fluorite | Level 6
it is a numeric value
Astounding
PROC Star

You get no information until you actually answer my questions.

Rixile106
Fluorite | Level 6

Rixile106_0-1693313893486.png

 

PaigeMiller
Diamond | Level 26

Numbers like this look like dates to human, but are not dates to SAS. The conversion is

 

newdate=input(put(date,8.),yymmdd8.);
format new_date date9.;
--
Paige Miller
Astounding
PROC Star

You answered one question, but not the other.  Without knowing the variable name you are talking about, we have to guess which variable you mean.

 

@PaigeMiller took a good guess.  I suggest you try his solution.  But be consistent in your choice of names for the new variable:  new_date vs. newdate.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1147 views
  • 0 likes
  • 3 in conversation