Help using Base SAS procedures

Use user-defined and SAS defined formats on one variable?

Reply
Frequent Contributor
Posts: 100

Use user-defined and SAS defined formats on one variable?

Experts:
Another beginner question. What to do when you want to use a SAS defined format for some values and apply a user-defined format for the rest? For example, if you have a variable for hire date, you need to show most dates in mmddyy10. but for super early hire dates, you want to show "long tenure" (instead of the specific date).

Thank you!

proc format;
Value Tenure
low-'01Jan1970'd='Long Tenure';
run;
proc print data=sasuser.navigators;
format hired Tenure.;
run;
Super User
Posts: 9,687

Re: Use user-defined and SAS defined formats on one variable?

Hi.
That is easy.

[pre]
proc format;
Value Tenure
low-'01Jan1970'd='Long Tenure'
other=[mmddyy10];
run;
[/pre]


Ksharp
Frequent Contributor
Posts: 100

Re: Use user-defined and SAS defined formats on one variable?

Many thanks! I tried without the [] before posting the question...and of course that was not a good idea :-).
Ask a Question
Discussion stats
  • 2 replies
  • 339 views
  • 0 likes
  • 2 in conversation