LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2003, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 21 May 2003 08:17:14 -0400
Reply-To:     "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM>
Subject:      Re: putting a formatted value in a macro variable
Comments: To: Martin Kappler <kappler@BGFA.RUHR-UNI-BOCHUM.DE>
Content-Type: text/plain; charset="iso-8859-1"

It is possible with %sysfunc. Ironically, %sysfunc is an enhancement that allows the data step functions to propagate outside of that structure.

proc format ; value fmt 1 = "low" 2 = "medium" 3 = "high"; run ;

%let val = 1 ;

%let label = %sysfunc( putn ( &val. , fmt. ) ) ;

11 %put <<<&label.>>> ; <<<low>>>

__________________________ Venky Chakravarthy E-mail: swovcc@hotmail.com

-----Original Message----- From: Martin Kappler [mailto:kappler@BGFA.RUHR-UNI-BOCHUM.DE] Sent: Wednesday, May 21, 2003 7:50 AM To: SAS-L@LISTSERV.UGA.EDU Subject: putting a formatted value in a macro variable

Hello,

I'm searching for a possibility to put a formatted value into a macro variable. I know that it is possible via a data step and call symput (see below), but I wish to do the whole thing with macro statements, avoiding proc or data steps.

Thanks in advance for your help! Martin Kappler

proc format; value fmt 1 = "low" 2 = "medium" 3 = "high"; run;

data _null_; value=3; call symput("label",put(value,fmt.)); run;

%put &label;

LEGAL NOTICE Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.


Back to: Top of message | Previous page | Main SAS-L page