BookmarkSubscribeRSS Feed
Saurabh_Amar
Calcite | Level 5

Hi,

What i need to do is create format for all possible values of a variable using proc format

For example if i have country_code and country_name as fields, what i want to do is

Proc format;

values $cntry

                    "US" = ""UNITED STATES OF AMERICA

                    "IND" = "INDIA"

                    ....

                    ....

                    till all possible values

run;

How can i do that in macros? What i did was took all possible values in different macros using call symput and count also but dont know how to write out the values part.

Regards,

Saurabh

1 REPLY 1
Linlin
Lapis Lazuli | Level 10

you can use your dataset to create format. search create format from sas dataset:

http://www2.sas.com/proceedings/forum2007/068-2007.pdf

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 1 reply
  • 939 views
  • 1 like
  • 2 in conversation