Write and run SAS programs in your web browser

Bug in SAS Log when msglevel=I system option is specified

Reply
Contributor
Posts: 26

Bug in SAS Log when msglevel=I system option is specified

Hi SAS community,

 

I am not sure if I am alone, or anyone else is having the same issue here: once msglevel is set to I, no matter which programming statement I run (even if no data set is created), I always see the following weird message in the log:

 

 INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
       22:1     RC

I am using SAS Studio 3.5. This is really strange, because if no data set is created then how can there even be variables in the first place, let alone truncation?

 

Thanks

 

 

Grand Advisor
Posts: 16,416

Re: Bug in SAS Log when msglevel=I system option is specified

If you restart SAS and see the same error with this option on I would report it to SAS Tech Support. 

 

I'll see if I can replicate it when I'm in front of SAS Studio again. 

Esteemed Advisor
Posts: 5,995

Re: Bug in SAS Log when msglevel=I system option is specified

You set the loglevel to "Info", which means that SAS will give you additional information in the log which you normally wouldn't get.

Here SAS gives you the information that a character variable was set to the default length of 200 (some actions cause this when the length of a variable is not explicitly specified); this information could help you with determining the cause for truncated values, or it could notify you of unnecessarily wasted space.

 

Bottom line: perfect behaviour when using loglevel "I", no bug at all.

 

For further information, supply the code to which this message points (the data step that includes log line 22)

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 26

Re: Bug in SAS Log when msglevel=I system option is specified

Thank you all for your help. 

 

@KurtBremser Once msglevel is set to I, absolutely ANY programming statement will generate this weird message in the log, even something as simple as this:

 

options msglevel=i;

proc setinit;
run;
Esteemed Advisor
Posts: 5,995

Re: Bug in SAS Log when msglevel=I system option is specified

Then I'd recommend that you post the log, including the whole step into which the NOTE points by line number.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 26

Re: Bug in SAS Log when msglevel=I system option is specified

Here is another simple SAS program that can be used to illustrate this problem (I could have used ANY other programming statement and the bug will always persist once MSGLEVEL is set to I):

 

options msglevel=i;

data _null_;
put "Testing";
run;

This is nothing serious; nevertheless that INFO message has no reason to be there:

 

 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
       22:1     RC
 55         
 56         data _null_;
 57         put "Testing";
 58         run;
 
 Testing
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       user cpu time       0.00 seconds
       system cpu time     0.00 seconds
       memory              763.93k
       OS Memory           27296.00k
       Timestamp           12/07/2016 11:36:00 PM
       Step Count                        26  Switch Count  28
       Page Faults                       0
       Page Reclaims                     398
       Page Swaps                        0
       Voluntary Context Switches        56
       Involuntary Context Switches      0
       Block Input Operations            0
       Block Output Operations           0
       
 
 59         
 60         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
Grand Advisor
Posts: 16,416

Re: Bug in SAS Log when msglevel=I system option is specified

[ Edited ]

Interesting, I can replicate this issue in SAS University Edition. Please report to SAS Tech Support, if you haven't. Though I think SAS Studio 3.6 is out now. 

 

First run - set msglevel=i - No Errors

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 53         
 54         options msglevel=i;
 55         
 56         data _null_;
 57          put "Testing";
 58         run;
 
 Testing
 NOTE: DATA statement used (Total process time):
       real time           0.01 seconds
       cpu time            0.00 seconds
       
 
 59         
 60         proc means data=sashelp.class;
 61         run;
 
 NOTE: Multiple concurrent threads will be used to summarize data.
 NOTE: There were 19 observations read from the data set SASHELP.CLASS.
 NOTE: PROCEDURE MEANS used (Total process time):
       real time           0.07 seconds
       cpu time            0.08 seconds
       
 
 62         
 63         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 74  

Second run - messsage is present and same log? No extra information.

 

1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
       21:1     RC
 53         
 54         data _null_;
 55          put "Testing";
 56         run;
 
 Testing
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.01 seconds
       
 
 57         
 58         proc means data=sashelp.class;
 59         run;
 
 NOTE: Multiple concurrent threads will be used to summarize data.
 NOTE: There were 19 observations read from the data set SASHELP.CLASS.
 NOTE: PROCEDURE MEANS used (Total process time):
       real time           0.05 seconds
       cpu time            0.05 seconds
       
 
 60         
 61         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         

 

If I run only PROC MEANS - no character variables or text columns.

 

 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result.
       21:1     RC
 53         
 54         proc means data=sashelp.class;
 55         run;
 
 NOTE: Multiple concurrent threads will be used to summarize data.
 NOTE: There were 19 observations read from the data set SASHELP.CLASS.
 NOTE: PROCEDURE MEANS used (Total process time):
       real time           0.05 seconds
       cpu time            0.05 seconds
       
 
 56         
 57         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 68 

 

Esteemed Advisor
Posts: 5,995

Re: Bug in SAS Log when msglevel=I system option is specified

[ Edited ]

The fact that your logs start with line 1 (which basically sets all options for no log output) and then continues with line 53 lets me think that Studio runs some automatic code, part of which (happening in the invisible line 21) causes the NOTE.

Since Studio runs that code for every submit, you will always get the note, no matter what you run.

 

PS note that even the options msglevel statement itself does not show up in the log.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Grand Advisor
Posts: 16,416

Re: Bug in SAS Log when msglevel=I system option is specified


KurtBremser wrote:

 

PS note that even the options msglevel statement itself does not show up in the log.


It does in the first set of code, the only one I submitted it on. 

 

I concur that there must be some automatic SAS Studio code being run. 

SAS Employee
Posts: 3

Re: Bug in SAS Log when msglevel=I system option is specified

If you turn on the General preference in UE/SAS Studio  "Show generated code in SAS log", you will see the code that UE/SAS Studio runs before every program to set things up.  With that on, you can see the line that the INFO message is referring to:

 

17 DATA _NULL_;
18 CALL SYMPUT("GRAPHINIT","");
19 CALL SYMPUT("GRAPHTERM","");
20 RC=TSLVL('GEOCODE','N');
21 _ERROR_=0;
22 IF (RC^=' ') THEN DO;
23 CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
24 CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
25 END;
26 RUN;
 
INFO: Character variables have defaulted to a length of 200 at the places given by:
(Line)Smiley SadColumn). Truncation can result.
20:1 RC
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

Line 20 is 

20 RC=TSLVL('GEOCODE','N');

 

Like many of the character functions, the variable that TSLVL is returned to is defaulted to a length of 200 characters if a specific length is not defined.  That is what the INFO message is stating.  I have entered a request to have a LENGTH RC $10; statement added before that so the message will not appear.

 

You can see the same results with MSGLEVEL=i if you run the following code:

 

data _null_;

x = cats('ginger',' bread');

put x=;

run;

 

and see that you don't get the result if you submit 

 

data _null_;

length x $15;

x = cats('ginger',' bread');

put x=;

run;

 

Thanks for reporting this!

 

Regards,

Grace 

 

 

Post a Question
Discussion Stats
  • 9 replies
  • 348 views
  • 5 likes
  • 4 in conversation