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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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