BookmarkSubscribeRSS Feed
yanamadala85
Obsidian | Level 7

 

I have written the 'stdid' function using proc fcmp, I have used attrib statement but unfortunately i am getting the warning like "WARNING: The LABEL statement has no effect in a FUNCTION or SUBROUTINE."

 

I have referred the following SAS site.

http://support.sas.com/documentation/cdl/en/proc/68954/HTML/default/viewer.htm#n0seq1ln0q7zfrn1w44ym...

 

proc fcmp outlib=sasuser..study.demo;
function stdid(var1 $) $;
attrib var2 length=$25 format=$upcase9. label='x';
var2=tstrip(var1);
return(var2);
endsub;
run;

1 REPLY 1
Kurt_Bremser
Super User

That is because inside the function you are only dealing with temporary variables (that will not appear in the step where you call the function), and the output is just a value, with no attributes other than length.

Therefore only the length= has an effect.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1337 views
  • 0 likes
  • 2 in conversation