proc format ;
value $ gender 'F'='female' 'M'='male' ;
invalue sex 'F'=1 'M'=2 ;
run;
proc format fmtlib ;
select $gender sex;
run;
it i run above program it show only $ gender format.
how to show two formats at a time
Read the documentation for the select statement in proc format.
Does not make any sense? A column has one format, one informat, one label, and one name. In the below you are creating a format, fine, that can be assigned to the variable, and an informat, which is not used? A correct select statement if you want one as format and one as informat would be:
select sex format=$gender. informat=sex.
I expect you will now be going through all your old posts and marking them as correct/responding to users posting there?
From the documentation
entry(s)
specifies one or more catalog entries for processing. Catalog entry names are the same as the name of the informat or format that they store. Because informats and formats can have the same name, and because character and numeric informats or formats can have the same name, you must use certain prefixes when specifying informats and formats in the SELECT statement. Follow these rules when specifying entries in the SELECT statement:
Precede names of entries that contain character formats with a dollar sign ($). Precede names of entries that contain character informats with an at sign and a dollar sign (for example, @$entry-name). Precede names of entries that contain numeric informats with an at sign (@). Specify names of entries that contain numeric formats without
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.