Every time I submit code in SAS/Studio I get this annoying note (error) in the log.
INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result. 40:1 RC
I was able to track it down to this data step that SAS/Studio is prefixing to my code.
37 DATA _NULL_; 38 CALL SYMPUT("GRAPHINIT",""); 39 CALL SYMPUT("GRAPHTERM",""); 40 RC=TSLVL('SASXGOPT','N'); 41 _ERROR_=0; 42 IF (RC^=' ') THEN DO; 43 CALL SYMPUT("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;"); 44 CALL SYMPUT("GRAPHTERM","GOPTIONS NOACCESSIBLE;"); 45 END; 46 RUN; INFO: Character variables have defaulted to a length of 200 at the places given by: (Line):(Column). Truncation can result. 40:1 RC
Can we please fix that so it does not generate that message?
Why is it even making the RC variable? It is not used anywhere.
Just change to generate code like this instead.
DATA _NULL_;
CALL SYMPUT("GRAPHINIT","");
CALL SYMPUT("GRAPHTERM","");
_ERROR_=0;
IF (TSLVL('SASXGOPT','N')^=' ') THEN DO;
CALL SYMPUTX("GRAPHINIT","GOPTIONS RESET=ALL GSFNAME=_GSFNAME;");
CALL SYMPUTX("GRAPHTERM","GOPTIONS NOACCESSIBLE;");
END;
RUN;
@alexal wrote:
@Tom ,
Did you set MSGLEVEL=i? If yes, that setting generates additional notes in the SAS log.
I have no idea whether I set it or not. Or whether SAS/Studio did either.
But it doesn't change the fact that the code should be fixed. It is just sloppy coding to create character variables without a way for the data step to know what length it should use. Which is why SAS is issuing that line in the log.
@Tom ,
Thanks for your response. What version of SAS is it? I need that information to open a feature request.
SAS/Studio is 3.71. Not sure the SAS version matters.
Here is the About message.
Release: 3.71 (Enterprise Edition) Supported browsers: Microsoft Internet Explorer 11 Mozilla Firefox 21+ Google Chrome 27+ Apple Safari 6.0+ (on Apple OS X) Build date: Aug 14, 2019 11:45:53 AM SAS Mid-tier release: May 24, 2019 9:45:00 AM Java Version: 1.7.0_151 SAS release: 9.04.01M5P09132017 SAS platform: Linux LIN X64 2.6.32-696.13.2.el6.x86_64
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.