Date: Thu, 28 Aug 2008 08:56:05 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: Re: < label: > procedure statement.
In-Reply-To: <ce1fb7450808280835x6249d243r87e8b6d6af2f20a7@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"
It looks like you are right - I was wondering if your case of the label:
statement was a global statement, although the documentation lists it as
a data step statement, and that is why it also worked in procedures. At
least the error message it generates is different.
26 Proc Freq data=sashelp.class;
27 'Table 2'n: tables name;
ERROR: 'Table 2'N is not a valid statement label because it is not a
valid SAS name.
28 'Table_1'n: tables name;
29 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
30 data class;
31 set sashelp.class;
32 'label 1'n: name=upcase(name);
----------
306
ERROR 306-185: The label label 1 is not a valid SAS name.
33 run;
To answer Akshaya it doesn't look like you can specify such a label:
value with a name literal, so it appears to follow the standard naming
convention of underscore/alpha followed by underscore/alpha/digits.
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: ./ ADD NAME=Data _null_, [mailto:iebupdte@gmail.com]
Sent: Thursday, August 28, 2008 8:36 AM
To: Choate, Paul@DDS
Cc: SAS-L@listserv.uga.edu
Subject: Re: < label: > procedure statement.
I'm not talking about the label statement in the data step.
On 8/28/08, Choate, Paul@DDS <pchoate@dds.ca.gov> wrote:
> Since statement labels can only be reached from within the same
datastep
> I don't see how it could be referenced by a GO TO statement, a LINK
> statement, a HEADER= option in a FILE statement, or the EOF= option in
> an INFILE statement, since those are datastep statements and not
> procedure statements.
>
> "Restriction: If a statement in a DATA step is labeled, it should be
> referenced by a statement or option in the same step."
>
> Interesting idea though.
>
> Paul Choate
> DDS Data Extraction
> (916) 654-2160
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
./
> ADD NAME=Data _null_,
> Sent: Thursday, August 28, 2008 6:36 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: < label: > procedure statement.
>
> Some procedures like REG support label: statements. For REG MODEL,
> MTEST and TEST statements have documented LABEL support. These labels
> show up in various places in the output to help identify the
> statements that generated the specific bits of output.
>
> I haven't tested this extensively but it seems than many other
> statements can have <label>: .
>
> 386 Freq:
> 386! proc freq data=sashelp.class;
> 387 Table: tables _all_;
> 388 run: run;
>
> NOTE: There were 19 observations read from the data set SASHELP.CLASS.
>
> Is there a way to exploit this?
>
|