| Date: | Thu, 27 Jan 2011 12:21:48 -0500 |
| Reply-To: | bbser 2009 <bbser2009@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | bbser 2009 <bbser2009@GMAIL.COM> |
| Subject: | Re: label, input control data set, proc format |
|
| In-Reply-To: | <AANLkTim5PHrPmvuPHQAjJNUUAkf6sOe+hiNwubDDv893@mail.gmail.com> |
| Content-Type: | text/plain; charset="US-ASCII" |
including hlo="F". Thanks a lot, Joe.
Max
From: Joe Matise [mailto:snoopy369@gmail.com]
Sent: January-27-11 11:48 AM
To: bbser 2009
Cc: SAS-L@listserv.uga.edu
Subject: Re: label, input control data set, proc format
I'd suggest you read a bit more on SAS Formats with CNTLIN, then, if you
don't see why it works :)
Particularly, read what the HLO variable does; that's the variable you're
not including on your dataset that is necessary in this case.
-Joe
On Thu, Jan 27, 2011 at 10:42 AM, bbser 2009 <bbser2009@gmail.com> wrote:
Joe
Great idea. I followed like the code below. It turned out the output said
the value of label was dollar8.
But it does not help in my situation regarding this following code:
data a;
fmtname="xfmt";
start=1000;
end=1000;
label="dollar8."; * or simply dollar8. without the quotations;
type="n";
run;
I tried several other options: like label=dollar8., label="[dollar8.]" or
without the quotations, neither worked as expected.
Further help?
Max
================== code =======================
proc format;
value joe
1000=[dollar8.];
run;
proc format cntlout=joe;
select joe;
run;
proc contents data=joe;
run;
data c;
x=1000;
format x joe.;
put x=;
run;
From: Joe Matise [mailto:snoopy369@gmail.com]
Sent: January-27-11 11:26 AM
To: bbser 2009
Cc: SAS-L@listserv.uga.edu
Subject: Re: label, input control data set, proc format
When using CNTLIN and unsure how to create a format, I recommend creating
the format by hand (ie,
PROC FORMAT;
value whatever
whatever=whatver;
quit;
)
Then using CNTLOUT to see what it looks like:
proc format cntlout=whatever;
select whatever;
quit;
And then matching it in your CNTLIN :)
-Joe
On Thu, Jan 27, 2011 at 10:20 AM, bbser 2009 <bbser2009@gmail.com> wrote:
SAS documentation says this about the variable label in an input control
data set:
LABEL
a character variable whose value is the informatted or formatted value or
the name of an existing informat or format
I was wondering, how to use an existing informat or format with label?
I wrote the code below and expected the output would be like "$1,000", but
never worked. Please help. Thanks.
Max
===========
data a;
fmtname="xfmt";
start=1000;
end=1000;
label="dollar8."; * or simply dollar8. without the quotations;
type="n";
run;
proc format cntlin=a;
run;
data b;
x=1000;
format x xfmt.;
put x=;
run;
|