BookmarkSubscribeRSS Feed
grnreddy06
Calcite | Level 5

Hi,

 

I am trying to run the below code inside a macro.


data PREMIUM_QTR_I (drop=DOB);
set wcheck.PREMIUM_WL_MASTER_DATA_MC (keep=UID IDENTIFICATION_NUMBERS PASSPORTS DOB COUNTRIES LISTNAME);
QID=substr(substr(IDENTIFICATION_NUMBERS,find(IDENTIFICATION_NUMBERS," { QA-NID } " ) + 8,17),1,11);
DOB_YEAR=SUBSTR(STRIP(DOB),1,4);
format DOB_YEAR $4.;
PASSPORTS=UPCASE(SCAN(PASSPORTS,1));
DOB1=DOB;
where LISTNAME="QA_LIST" and IDENTIFICATION_NUMBERS is not null or PASSPORTS is not null
;
run;

Then I got the below note error :

 

 _
49
4 ! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.

 

Kindly help to resolve this issue, even I restarted the EG, though no use again am getting the same error.

 

8 REPLIES 8
Kurt_Bremser
Super User

This is usually the consequence of having unbalanced quotes upstream in the code. The simplest solution: start a new SAS session and submit the code there.

The NOTE is often accompanied by "The quoted string has become more than 262 characters long".

If the problem persists, submit your code in single steps, so you can catch the place where the problem first appears.

 

Please use a DESCRIPTIVE subject line in the future. A single underline(!) is not descriptive at all and shines a very bad light on your mental setup. I edited your post.

grnreddy06
Calcite | Level 5
Thank you Bremser for your response, by mistake I copied wrong subject line, sorry for the inconvenience.
I have restarted the EG, still am getting the same error. there are no unbalanced quotes also in the code.
Kurt_Bremser
Super User

Let's start from the ground up.

Start a new SAS session, do not load any code, but run something simple like

data class;
set sashelp.class;
run;

This is to verify that you do not have something toxic in your startup code.

grnreddy06
Calcite | Level 5
Sure Kurt, thank you for your response.
ballardw
Super User

@grnreddy06 wrote:

Hi,

 

I am trying to run the below code inside a macro.


data PREMIUM_QTR_I (drop=DOB);
set wcheck.PREMIUM_WL_MASTER_DATA_MC (keep=UID IDENTIFICATION_NUMBERS PASSPORTS DOB COUNTRIES LISTNAME);
QID=substr(substr(IDENTIFICATION_NUMBERS,find(IDENTIFICATION_NUMBERS," { QA-NID } " ) + 8,17),1,11);
DOB_YEAR=SUBSTR(STRIP(DOB),1,4);
format DOB_YEAR $4.;
PASSPORTS=UPCASE(SCAN(PASSPORTS,1));
DOB1=DOB;
where LISTNAME="QA_LIST" and IDENTIFICATION_NUMBERS is not null or PASSPORTS is not null
;
run;

Then I got the below note error :

 

 _
49
4 ! ;
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS release. Inserting white space
between a quoted string and the succeeding identifier is recommended.

 

Kindly help to resolve this issue, even I restarted the EG, though no use again am getting the same error.

 


Copy the text for the entire data step plus all the notes and warnings. Paste the copied text into a text box opened on the forum with the </> icon.

That particular message places an _ on the line below where the issue is found.

An example of code that will generate that note:

179  data _null_;
180    y=3;
181    put "how to generate a 49-169 note"y;
           ------------------------------
           49
NOTE 49-169: The meaning of an identifier after a quoted string might change in a future SAS
             release.  Inserting white space between a quoted string and the succeeding
             identifier is recommended.

182  run;

how to generate a 49-169 note3

See the underscores under the text "how to generate a 49-169 note"? The main message windows on this forum reformat text to remove multiple blanks in many cases so what you pasted doesn't have all those spaces that might tell us where the issue actually happened.

SAS has several bits of code where a letter immediately following quoted text is treated specially. a D would mean a "date" value if properly formatted,T time, DT datetime, X a Hex coded numeric value. So the note is not an error now but in the future quoted text followed immediately with a Y might stand for some specific type of other data. What SAS is warning you to do is simply place a space between the quoted text and the Y.

 

My guess is that perhaps you actually have code of

where LISTNAME="QA_LIST"and IDENTIFICATION_NUMBERS is not null or PASSPORTS is not null

 

JackHamilton
Lapis Lazuli | Level 10

Also, it would make the intent of your program more clear if you put parentheses in your WHERE statement.  Do you mean 

 

where (LISTNAME="QA_LIST" and IDENTIFICATION_NUMBERS is not null) or PASSPORTS is not null

or 

where LISTNAME="QA_LIST" and (IDENTIFICATION_NUMBERS is not null or PASSPORTS is not null)

It's not ambiguous to the SAS parser, but it might be ambiguous to humans, especially a human who also uses other languages where the order of operations is different.  And how sure are you that the order of operations is the same in a WHERE statement, a similar IF statement, a WHERE clause in SQL, and an assignment statement?  There are at least two operators that have a different meaning in a WHERE statement than in an IF statement.

 

Another possible source of misunderstanding is the location of your WHERE statement.  Suppose you have code like this:

data in;
    infile cards;
    input listname $8.;
cards4;
QA_LIST
qa_list
;;;;
data out ;
    set in;
    listname = upcase(listname);
    where LISTNAME="QA_LIST" ;
run;

How many observations will be in OUT?

 

(As an exercise for the reader, how will the results be different if that code is run inside a macro vs. in open code?)

 

 

ChrisNZ
Tourmaline | Level 20

I don't see anything in your code that will generate this message: there is always a space after the quotes.

Please turn option mprint on and post the full log for this step.

 

Also when pasting code, use the appropriate icon.

 

 

JackHamilton
Lapis Lazuli | Level 10

I occasionally get that message.  It usually doesn't have an obvious cause, and it's always inside a macro.  I wonder if the macro processor is not handling quoting/unquoting correctly under some obscure circumstances, so the SAS parser sees something like 

x = "myvalue"<invisible-macro-quoting-character>;

then thinks that the quoting character is trying to be an identifier character, and objects.

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1311 views
  • 6 likes
  • 5 in conversation