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 (April 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 4 Apr 2001 07:59:45 -0700
Reply-To:     Pete Lund <pete.lund@NWCSR.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Pete Lund <pete.lund@NWCSR.COM>
Subject:      Re: Names of formats in version 8 still only 8 characters long?
Comments: To: Doug <nowaydougie_cam@HOTMAIL.COM>
In-Reply-To:  <3acaf8cf@dnews.tpgi.com.au>
Content-Type: text/plain; charset="iso-8859-1"

Hi Doug- Yes, catalog entries are limited to 8 characters - including format entries. You mention not getting a warning when you rename a format to more than 8 characters. I would consider that a bug in the SAS Explorer. It doesn't match the behavior of using too long a name in a PROC FORMAT. For instance, if you have:

proc format; value TooLongFormatName 1 = 'A' 2 = 'B'; run;

SAS will create a format called "TooLongF" and warn you that the name was too long and was truncated. You can then use that long name:

proc freq; tables x; format x TooLongFormatName.; run;

This will work just fine - you'll get another warning that the format name was truncated and the format "TooLongF" will be used. I would never recommend doing this, but it will work.

I would rather that both of these conditions were errors, not warnings, and that you were forced to use legal names. But that's the way it's been for a long time. However, as you note, if you renamed a format in SAS Explorer to "TooLongFormatName" that whole name is assigned to the format. It can never be used, though, because any data step or proc that tries to use it will truncate the name to 8 characters and there is no longer a matching format name.

Just a little more detail - hope it helps.

--------------------------------------------------------------------- Pete Lund Northwest Crime and Social Research 313-D Fifth Ave SE Olympia, WA 98501 (360) 280-4892 - voice (360) 570-7533 - fax pete.lund@nwcsr.com www.nwcsr.com ---------------------------------------------------------------------

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of Doug Sent: Wednesday, April 04, 2001 2:58 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Names of formats in version 8 still only 8 characters long?

This is a multi-part message in MIME format.

------=_NextPart_000_0026_01C0BD41.8EA6E4C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

RE: Names of formats in version 8 still only 8 characters long?I suppose = I am asking - why not 32 characters? Is there any particular reason why = SAS cannot accept formats longer than 8?

Are all catalog entries restricted to 8 characters and if so - why = doesn't SAS warn about this when I rename formats to be 32 characters?

Doug

"Shapard Wolf" <shap.wolf@ASU.EDU> wrote in message = news:B6426E926476D411B8E800B0D03D5C1A010310F4@mainex2.asu.edu... 8-character names for formats is the documented behavior. This didn't = change when variables went to 32-char.=20

From the proc freq documentation:=20 = -------------------------------------------------------------------------= -------=20 Required Arguments=20

name=20 names the format you are creating. The name must be a SAS name up to = eight characters long, not ending in a number. Character format names = must have a dollar sign ($) as the first character and no more than = seven additional characters. A user-defined format cannot be the name of = a format supplied by SAS. Refer to the format later by using the name = followed by a period. However, do not put a period after the format name = in the VALUE statement.

= -------------------------------------------------------------------------= -------=20

best, shap=20

-----Original Message-----=20 From: Doug=20 Sent: 03 April 2001 1:52 PM=20 To: SAS-L@LISTSERV.UGA.EDU=20 Subject: Names of formats in version 8 still only 8 characters long?=20

I recently had the need to call the SI for advice on why a certain = macro=20 kept bombing out. The macro basically renamed some catalog entries = using a=20 look up table (proc catalog), then took these format catalog entries = and=20 created some datasets (using proc format cntlout), then exported them = to csv=20 format for use by Brio Query (using proc export).=20

What I found was that SAS was able to rename the formats to values of = up to=20 32 characters, however it was then unable to use them as it could not = read a=20 format back (to use in a proc format cntlout=3D statement) that had = more than=20 8 characters. To me this is rather odd. It reminded me of my old = mainframe=20 system where you were able to change you password to any value up to = 32=20 characters but then it would only accept the first 8 as a valid = password=20 thereby denying access due to a password mis-match.=20

The end result with the macro was that I simply did the rename during = the=20 proc export using a lookup table and a few call symputs and a call = execute.=20

Has anyone else come across this problem with SAS formats not being = able to=20 be used if they have a title of more than 8 characters? Just another = trap=20 for young players like myself (young in SAS years- that is).=20

Cheers=20

Doug=20

------=_NextPart_000_0026_01C0BD41.8EA6E4C0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>RE: Names of formats in version 8 still only 8 = characters long?</TITLE> <META content=3D"text/html; charset=3Diso-8859-1" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.3105.105" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>I suppose I am asking - why not 32 = characters? Is=20 there any particular reason why SAS&nbsp;cannot&nbsp;accept formats = longer than=20 8?</FONT></DIV> <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Are all catalog entries restricted to 8 = characters=20 and if so - why doesn't SAS warn about this when I rename formats to be = 32=20 characters?</FONT></DIV> <DIV>&nbsp;</DIV> <DIV><FONT face=3DArial size=3D2>Doug</FONT></DIV> <DIV>&nbsp;</DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV>"Shapard Wolf" &lt;<A=20 href=3D"mailto:shap.wolf@ASU.EDU">shap.wolf@ASU.EDU</A>&gt; wrote in = message <A=20 = href=3D"news:B6426E926476D411B8E800B0D03D5C1A010310F4@mainex2.asu.edu">ne= ws:B6426E926476D411B8E800B0D03D5C1A010310F4@mainex2.asu.edu</A>...</DIV> <P><FONT size=3D2>8-character names for formats is the documented = behavior. This=20 didn't change when variables went to 32-char.</FONT> </P> <P><FONT size=3D2>From the proc freq documentation:</FONT> <BR><FONT=20 = size=3D2>----------------------------------------------------------------= ----------------</FONT>=20 <BR><FONT size=3D2>Required Arguments </FONT></P> <P><FONT size=3D2>name </FONT><BR><FONT size=3D2>names the format you = are=20 creating. The name must be a SAS name up to eight characters long, not = ending=20 in a number. Character format names must have a dollar sign ($) as the = first=20 character and no more than seven additional characters. A user-defined = format=20 cannot be the name of a format supplied by SAS. Refer to the format = later by=20 using the name followed by a period. However, do not put a period = after the=20 format name in the VALUE statement.</FONT></P> <P><FONT=20 = size=3D2>----------------------------------------------------------------= ----------------</FONT>=20 </P> <P><FONT size=3D2>best, shap</FONT> </P><BR> <P><FONT size=3D2>-----Original Message-----</FONT> <BR><FONT = size=3D2>From:=20 Doug</FONT> <BR><FONT size=3D2>Sent: 03 April 2001 1:52 PM</FONT> = <BR><FONT=20 size=3D2>To: SAS-L@LISTSERV.UGA.EDU</FONT> <BR><FONT size=3D2>Subject: = Names of=20 formats in version 8 still only 8 characters long?</FONT> </P><BR> <P><FONT size=3D2>I recently had the need to call the SI for advice on = why a=20 certain macro</FONT> <BR><FONT size=3D2>kept bombing out.&nbsp; The = macro=20 basically renamed some catalog entries using a</FONT> <BR><FONT = size=3D2>look up=20 table (proc catalog), then took these format catalog entries = and</FONT>=20 <BR><FONT size=3D2>created some datasets (using proc format cntlout), = then=20 exported them to csv</FONT> <BR><FONT size=3D2>format for use by Brio = Query=20 (using proc export).</FONT> </P> <P><FONT size=3D2>What I found was that SAS was able to rename the = formats to=20 values of up to</FONT> <BR><FONT size=3D2>32 characters, however it = was then=20 unable to use them as it could not read a</FONT> <BR><FONT = size=3D2>format back=20 (to use in a proc format cntlout=3D statement) that had more = than</FONT>=20 <BR><FONT size=3D2>8 characters.&nbsp; To me this is rather odd. It = reminded me=20 of my old mainframe</FONT> <BR><FONT size=3D2>system where you were = able to=20 change you password to any value up to 32</FONT> <BR><FONT = size=3D2>characters=20 but then it would only accept the first 8 as a valid password</FONT> = <BR><FONT=20 size=3D2>thereby denying access due to a password mis-match.</FONT> = </P> <P><FONT size=3D2>The end result with the macro was that I simply did = the rename=20 during the</FONT> <BR><FONT size=3D2>proc export using a lookup table = and a few=20 call symputs and a call execute.</FONT> </P> <P><FONT size=3D2>Has anyone else come across this problem with SAS = formats not=20 being able to</FONT> <BR><FONT size=3D2>be used if they have a title = of more=20 than 8 characters?&nbsp; Just another trap</FONT> <BR><FONT = size=3D2>for young=20 players like myself (young in SAS years- that is).</FONT> </P> <P><FONT size=3D2>Cheers</FONT> </P> <P><FONT size=3D2>Doug</FONT> </P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0026_01C0BD41.8EA6E4C0--


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