BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi: I get this warning message when I attempt to change a variable length. Any idea how to get rid off this message?

data stdlabnames;
148 length standard_lab_type $25 standard_lab_name $50 lbtestid $30;
149 format _all_; informat _all_;
150
151 set rawdata.standard_lab_names;
NOTE: Data file RAWDATA.STANDARD_LAB_NAMES.DATA is in a format that is native to another host, or the file
encoding does not match the session encoding. Cross Environment Data Access will be used, which might
require additional CPU resources and might reduce performance.
The SAS System

152
153 keep standard_lab_type standard_lab_name lbtestid restype;
154
155 run;

WARNING: Multiple lengths were specified for the variable STANDARD_LAB_TYPE by input data set(s). This may
cause truncation of data.
WARNING: Multiple lengths were specified for the variable STANDARD_LAB_NAME by input data set(s). This may
cause truncation of data.
WARNING: Multiple lengths were specified for the variable LBTESTID by input data set(s). This may cause
truncation of data.
5 REPLIES 5
Patrick
Opal | Level 21
Hi

SAS nicely tells you that your new variable lengths are shorter than the ones in the source data set. So the warning as such is appropriate.

I wouldn't now how to suppress such a warning - but you could of course change the lengths in a post processing step, i.e.

data stdlabnames;
format _all_; informat _all_;
set rawdata.standard_lab_names (keep=standard_lab_type standard_lab_name lbtestid restype);
run;

proc sql;
alter table stdlabnames
modify
standard_lab_type char(25)
,standard_lab_name char(50)
,lbtestid char(30)
;
quit;

Another way would be to just rename the variables when you read them (a rename as part of the set statement) and then define the output vars the way you want them and assign the renamed vars to the output vars.


HTH
Patrick

Message was edited by: Patrick Message was edited by: Patrick
twocanbazza
Quartz | Level 8
There is an option that globally turns this warning off, can't remember of the top of my head the exact syntax... try searching SAS site for "Length & Warning"

Barry
MJyothi
Calcite | Level 5
Hi,

You can try this system option to turn off warning message.
options varlenchk=nowarn;
MJyothi
Calcite | Level 5
Hi,

You can try this system option to turn off warning message.
options varlenchk=nowarn;
deleted_user
Not applicable
Thank you all.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 5 replies
  • 1375 views
  • 0 likes
  • 4 in conversation