Date: Tue, 17 Dec 2002 15:47:58 -0700
Reply-To: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Hamilton <JackHamilton@FIRSTHEALTH.COM>
Subject: Re: SAS name characteristics
Content-Type: text/plain; charset=us-ascii
The '@' is stored in the catalog, as you can see by browsing the binary
file. SAS chooses to display format characteristics different ways in
different places. Ed is right - it's not consistent.
--
JackHamilton@FirstHealth.com
Manager, Technical Development
METRICS Department, First Health
West Sacramento, California USA
>>> "Delaney, Kevin P." <khd8@CDC.GOV> 12/17/2002 2:27 PM >>>
Doesn't seem like it's (the @ ) in the catalog:
212 proc format fmtlib;
213 value test 1="YES" 0="NO";
NOTE: Format TEST has been output.
214 invalue test "YES"=1 "No"=0;
NOTE: Informat TEST has been output.
215 value $test "Y"="Yes" "N"="No";
NOTE: Format $TEST has been output.
216 invalue $test "Yes"="Y" "No"="N";
NOTE: Informat $TEST has been output.
217 run;
NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
218
219 proc catalog c=work.formats;
220 change @test=@tested;
-
22
76
NOTE: The previous statement has been deleted.
ERROR 22-322: Expecting a name.
ERROR 76-322: Syntax error, statement will be ignored.
221 quit;
NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE CATALOG used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
222
223 proc catalog c=work.formats;
224 contents;
225 *change @test=@tested;
226 *contents;
227 change test=tested (et=infmtc);
228 contents;
229 change tested=test (et=infmtc);
230 contents;
231 quit;
NOTE: Changing entry TEST.INFMTC to TESTED.INFMTC in catalog
WORK.FORMATS.
NOTE: Changing entry TESTED.INFMTC to TEST.INFMTC in catalog
WORK.FORMATS.
NOTE: PROCEDURE CATALOG used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
Seems like we need to use Entry type (or type=(I J N C) in a CNTLOUT
data
set or fmttype=(F I) in dictionary.formats) to identify which
(in)format to
rename. The only place I have seen the @ show up is in the Fmtlib (or
Page)
listing of a format library. Maybe I am missing something. Maybe we
are
all spending too much time worrying about something that we "don't need
to
know" about!!
Kevin Delaney
KDelaney@cdc.gov
-----Original Message-----
From: Ian Whitlock [mailto:WHITLOI1@WESTAT.com]
Sent: Tuesday, December 17, 2002 4:56 PM
To: 'Delaney, Kevin P.'; SAS-L (E-mail)
Subject: RE: SAS name characteristics
Kevin,
It is stored in the catalog, since you don't need to know about it, it
isn't
shown to you on need to know basis. SAS is a user friendly system so
the
convert the @ to an I so you won't be confused. Now you aren't
confused,
are you?
IanWhitlock@westat.com
-----Original Message-----
From: Delaney, Kevin P. [mailto:khd8@CDC.GOV]
Sent: Tuesday, December 17, 2002 3:32 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: FW: SAS name characteristics
Thought I would muddy the waters a little more here, in V9 of SAS, we
have
the dictionary table dictionary.formats (and SASHELP.VFORMAT):
For those of you with V9, try this...
***********v9*****************;
proc format;
value test 1="YES" 0="NO";
invalue test "YES"=1 "No"=0;
value $test "Y"="Yes" "N"="No";
invalue $test "Yes"="Y" "No"="N";
run;
proc sql;
*describe table dictionary.formats;
select fmtname, fmttype, source from dictionary.formats where
libname="WORK"; quit;
So,
1) where does SAS Store the '@'
2) I've looked (albeit quickly) through the V9 documentation, any idea
what
Source is?
Valid values appear to be B, C, and U ???
Kevin Delaney
KDelaney@cdc.gov
-----Original Message-----
From: Ed Heaton [mailto:EdHeaton@WESTAT.COM]
Sent: Tuesday, December 17, 2002 2:54 PM
Subject: Re: SAS name characteristics
Ian,
Sorry for being unclear. From the SAS online docs...
When SAS prints messages referring to a user-written informat, the name
is
prefixed by an at sign (@). When the informat is stored, the at sign
is
prefixed to the name you specify for the informat, which is why you
are
limited to only seven characters in the name. You need to use the at
sign
only when you are using the name in an EXCLUDE or SELECT statement; do
not
prefix the name with an at sign when you are associating the informat
with a
variable.
Ed
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3992
mailto:EdHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Ian Whitlock
Sent: Tuesday, December 17, 2002 2:50 PM
To: Ed Heaton; SAS-L@LISTSERV.UGA.EDU
Subject: RE: SAS name characteristics
Ed,
In what sense is that true?
454 data w ;
NOTE: SCL source line.
455 input x @f3. ;
---
22
ERROR 22-322: Expecting a name.
456 put x= ;
457 cards ;
Or perhaps more entertaining.
489 proc format ;
NOTE: SCL source line.
490 invalue @mynumtolong "1" = 100 ;
-
22
-----------
202
NOTE: The informat name '@MYNUMTOLONG' exceeds 8 characters. Only the
first
8 characters will be
used.
ERROR 22-322: Syntax error, expecting one of the following: a name, $.
ERROR 202-322: The option or parameter is not recognized and will be
ignored.
Reminds me of the time Marianne used a spelling checker and got the
message
"No alternative to your word (misspelled alternative)."
IanWhitlock@westat.com
-----Original Message-----
From: Ed Heaton
Sent: Tuesday, December 17, 2002 2:27 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS name characteristics
Jack,
Remember that informats all have a leading @, so your informat name is
nine
characters.
Ed
Edward Heaton, Senior Systems Analyst,
Westat (An Employee-Owned Research Corporation),
1600 Research Boulevard, Room RW-3541, Rockville, MD 20850-3195
Voice: (301) 610-4818 Fax: (301) 294-3992
mailto:EdHeaton@westat.com http://www.westat.com
-----Original Message-----
From: Jack Hamilton [mailto:JackHamilton@FIRSTHEALTH.COM]
Sent: Friday, December 13, 2002 9:02 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: SAS name characteristics
What SAS says about this does not appear to be completely true. Here's
a
job log from 8.2:
-----
22 proc format;
23 invalue longname
NOTE: The informat name '@LONGNAME' exceeds 8 characters. Only the
first 8
characters will be used.
24 'a' = 1
25 'b' = 2;
NOTE: Informat LONGNAM has been output.
26 run;
NOTE: PROCEDURE FORMAT used:
real time 0.01 seconds
cpu time 0.00 seconds
27
28 data _null_;
29 test1 = input('a', longname.);
30 test2 = input('b', longnamx.);
31 put (_all_) (=);
32 run;
test1=1 test2=2
NOTE: DATA statement used:
real time 0.03 seconds
cpu time 0.03 seconds
-----
So:
1) An 8 character name is allowed for an informat.
2) A misleading message is issued saying that only the first 8
characters
will be used (misleading because it doesn't tell you that it inserted
an @
at the beginning).
3) The first 7 characters of the name you entered are used when SAS
searches
for the informat name.
--
JackHamilton@FirstHealth.com
Manager, Technical Development
METRICS Department, First Health
West Sacramento, California USA
>>> "Chakravarthy, Venky" <Venky.Chakravarthy@PFIZER.COM> 12/13/2002
4:54 AM >>>
Jim,
First, note that user INFORMATS are still subject to the 7 character
limitation because an @ sign is prefixed by SAS prior to storage.
As far as documentation goes, there is a section on names:
SAS OnlineDoc
Base SAS Software
SAS Language Reference: Dictionary
Appendices
Rules for Words and Names
Names in the SAS Language
Kind Regards,
__________________________
Venky Chakravarthy
E-mail: swovcc@hotmail.com
-----Original Message-----
From: Jim Groeneveld [mailto:J.Groeneveld@ITGROUPS.COM]
Sent: Friday, December 13, 2002 5:57 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: SAS name characteristics
Hi friends,
I always thought in (from) version 8.x only variable names might be 32
characters long, other SAS names only 8. So I stuck to that, until I
recently accidentally noticed valid dataset names with names longer
than 8
characters. So, in order to debug my macro SAS_name I would like to
know the
maximum length of names in SAS 8.x+ for:
* variables (32)
* datasets (???)
* libraries (8?)
* formats (8)
* variable labels (256)
* .........
And where are these characteristics documented properly (in any case
not in
the online help of 8.2)?
Regards - Jim.
--
Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070
senior statist./data man. P.O. Box 1 fax. +31 412 407 080
J.Groeneveld@ITGroups.com 5350 AA BERGHEM, NL www.imrotramarko.com
I think I master my computer, sometimes I seem to be its slave.
Notice of confidentiality: this e-mail may contain confidential
information
intended for the addressed recipient only. If you have received this
e-mail
in error please delete this e-mail and please notify the sender so
that
proper delivery can be arranged.
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.