BookmarkSubscribeRSS Feed
expertyejin
Obsidian | Level 7

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

 

 

11 REPLIES 11
Reeza
Super User

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. 

Kurt_Bremser
Super User

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)

expertyejin
Obsidian | Level 7

Thank you all for your help. 

 

@Kurt_Bremser 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;
expertyejin
Obsidian | Level 7

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         
Reeza
Super User

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 

 

Kurt_Bremser
Super User

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.

Reeza
Super User

@Kurt_Bremser 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. 

grace_sas
SAS Employee

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):(Column). 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 

 

 

Tom
Super User Tom
Super User

I installed the latest version of SAS/University Edition

https://communities.sas.com/t5/SAS-Analytics-U/Virtual-Box-5-2-8-SAS-University-Edition-myfolders-is...

and was surprised when this annoying INFO message no longer appeared in my SAS log.

I thought at first that perhaps SAS had fixed the buggy code (code that assigns a value to a character variable whose length was not previously defined) that SAS/Studio submits before every submission.  But no the code is still there.

 25         DATA _NULL_;
 26         CALL SYMPUT("GRAPHINIT","");
 27         CALL SYMPUT("GRAPHTERM","");
 28         RC=TSLVL('GEOCODE','N');
 29         _ERROR_=0;
 30         IF (RC^=' ') THEN DO;
 31         CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
 32         CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
 33         END;
 34         RUN;

Instead I see that INFO message is no longer appearing because the default setting for the MSGLEVEL option was changed from 'I' to 'N'.

 

Note that SAS could easily fix this so that the INFO message is not generate by adding this line above the line that is setting RC.

length rc $200;

Or better still eliminate the RC variable completely since it is not really used.

DATA _NULL_;
CALL SYMPUT("GRAPHINIT","");
CALL SYMPUT("GRAPHTERM","");
IF (NOT MISSING(TSLVL('GEOCODE','N'))) THEN DO;
  CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
  CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
END;
_ERROR_=0;
RUN;

Also why do they want to default the macro variables to a single unquoted space?  Why not just set them to nothing? 

%LET GRAPHINIT=;
%LET GRAPHTERM=;
DATA _NULL_;
IF (NOT MISSING(TSLVL('GEOCODE','N'))) THEN DO;
  CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
  CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
END;
_ERROR_=0;
RUN;
grace_sas
SAS Employee

Hi Tom,

 

The problem with that INFO message is not fixed in the current SAS University Edition release.  It will be fixed in an upcoming release.  The default for MSGLEVEL is N, so it may be that at some point the setting of your option was changed back from I to N?  

 

I don't know when the fix will be visible, but at this point, it is expected that the original problem still exists.

 

Regards,

Grace 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 5159 views
  • 8 likes
  • 5 in conversation