BookmarkSubscribeRSS Feed
Tom
Super User Tom
Super User

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;
5 REPLIES 5
yabwon
Amethyst | Level 16
I'm second to that idea

B-)
_______________
Polish SAS Users Group: www.polsug.com and communities.sas.com/polsug

"SAS Packages: the way to share" at SGF2020 Proceedings (the latest version), GitHub Repository, and YouTube Video.
Hands-on-Workshop: "Share your code with SAS Packages"
"My First SAS Package: A How-To" at SGF2021 Proceedings

SAS Ballot Ideas: one: SPF in SAS, two, and three
SAS Documentation



alexal
SAS Employee

@Tom ,

 

Did you set MSGLEVEL=i? If yes, that setting generates additional notes in the SAS log.

Tom
Super User Tom
Super User

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

alexal
SAS Employee

@Tom ,

 

Thanks for your response. What version of SAS is it? I need that information to open a feature request.

Tom
Super User Tom
Super User

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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1863 views
  • 5 likes
  • 3 in conversation