BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jimbobob
Quartz | Level 8

I'm trying use proc fcmp to create a function that in turn creates a format, I've tried using the SAS sample code: https://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#n1eyyzaux0ze5ln1k03g...

 

I know the sample given is formatting a numeric field, in my code my data in character and I want the format to come out as a character. in the attached code you can see the NAICS_CD column in the proc print comes out blank, but I want it to match the INDUSTRY_CD column. Attached is my code. thanks

1 ACCEPTED SOLUTION

Accepted Solutions
CurtisMackWSIPP
Lapis Lazuli | Level 10

You need to use a character format.  Notice the $.

 

proc format;
   value $FINDUSTRY_CD 
         other=[FINDUSTRY_CD()]; 
run;

View solution in original post

2 REPLIES 2
CurtisMackWSIPP
Lapis Lazuli | Level 10

You need to use a character format.  Notice the $.

 

proc format;
   value $FINDUSTRY_CD 
         other=[FINDUSTRY_CD()]; 
run;
jimbobob
Quartz | Level 8
Thanks been staring at this for hours. Apprecaite it.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 2 replies
  • 542 views
  • 1 like
  • 2 in conversation