DATA Step, Macro, Functions and more

Need to convert YYMMD7. to CHAR7

Reply
Occasional Contributor
Posts: 5

Need to convert YYMMD7. to CHAR7

I am trying to convert a calculated date with a YYMMD7. format to a CHAR format in a proc sql where clause. The table I am selecting from has a text date column (2018-01). I have tried using put(date, CHAR7.) and get an error. Is there something else I can do to make this work?  

Super User
Posts: 10,850

Re: Need to convert YYMMD7. to CHAR7

Posted in reply to kbone1975
data _null_;
x=put(today(),yymmd7.);
put x=;
run;
Occasional Contributor
Posts: 5

Re: Need to convert YYMMD7. to CHAR7

This worked perfectly-thanks!

 

 

Ask a Question
Discussion stats
  • 2 replies
  • 121 views
  • 1 like
  • 2 in conversation