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 (October 1997, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 28 Oct 1997 12:27:00 -0500
Reply-To:     Dave_Mabey_at_RDA8POSTOFFICE1%RDCCMAIL%READERSDIGEST@READERSDIGEST.COM
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Dave_Mabey_at_RDA8POSTOFFICE1%RDCCMAIL%READERSDIGEST@READERSDIGEST.COM
Subject:      Re: Inconsistency in SAS data step
Comments: To: druytsp@OIOV59.MRGATE.VESTA.UMC.AKZONOBEL.NL
Content-type: text/plain; charset=US-ASCII

Dave Mabey at RDA8POSTOFFICE1@RDCCMAIL 10/28/97 12:27 PM

New Text Item: Inconsistency in SAS data step

Certain characters effect the way a quoted string is interpreted. For example '...'x indicates the quoted string is hexadecimal, '....'d indicates a date, and '....'t indicates a time string. In your example, SAS is trying to read 't1 ='t1 as a time string. Why not just use < PUT t1= ; >?

By the way, a little bird told me that "n" will be added to the list of characters with special meaning when at the end of a quoted string. In version 7, it will indicate that the quoted string is a SAS variable name so that SAS variable names can contain Blanks,$#@. etc. This will permit SAS to use names from other data sources without using an "ACCESS" to map the columns to SAS names.

_____________________________ Reply Separator _____________________________ ____ Subject: Inconsistency in SAS data step Author: druytsp@OIOV59.MRGATE.VESTA.UMC.AKZONOBEL.NL@INTERNET at RDNOTES Date: 10/28/97 11:03 AM

(Embedded image moved to file: PIC001.PCX) Dear SAS-lers, After some trial and error I discovered a inconsistency (or even a bug?) in a SAS data step. Please take a look at the the following SAS code: data _null_; y1=0; put "Y1="y1; t1=0; put "T1=" t1; *** space between character string and name of variable; run; data _null_; y1=0; put "Y1="y1; t1=0; put "T1="t1; *** NO space between character string and name of variable; run;

This code produces the following LOG: 1 data _null_; 2 y1=0; 3 put "Y1="y1; 4 5 t1=0; 6 put "T1=" t1; 7 run; Y1=0 T1=0 8 9 data _null_; 10 11 y1=0; 12 put "Y1="y1; 13 14 t1=0; 15 put "T1="t1; ______ ______ ______ 22 22 22 200 200 200 16 run; ERROR 22-322: Expecting one of the following: NAME, NAME.NAME, #, +, @. ERROR 22-322: Expecting one of the following: NAME, NAME.NAME, #, +, @. ERROR 22-322: Expecting one of the following: NAME, NAME.NAME, #, +, @. The statement is being ignored. The statement is being ignored. The statement is being ignored. ERROR 200-322: The symbol is not recognized. ERROR 200-322: The symbol is not recognized. ERROR 200-322: The symbol is not recognized. NOTE: The SAS System stopped processing this step because of errors. ERROR: Errors printed on page 2. ERROR: Errors printed on page 2. ERROR: Errors printed on page 2. ERROR: SAS ended due to errors. ERROR: SAS ended due to errors. ERROR: SAS ended due to errors. You specified: OPTIONS ERRORABEND;. You specified: OPTIONS ERRORABEND;. You specified: OPTIONS ERRORABEND;. NOTE: SAS Institute BV, 1217 KR Hilversum, The Netherlands

So, SAS produces an error if there is no space between the character string and variable name T1. This is NOT the case for variable Y1. Please let me know what you think about this. I'm running SAS 6.08 on VMS version 5.5 Patrick Druijts SMTPOriginator: owner-sas-l@UGA.CC.UGA.EDU


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