The first warning is because you defined the length before the SET statement. It sounds like you did that on purpose. As long as the length of the VALUES of the variable read by the SET statement are not too long for the length you set for the variable then that should not cause any trouble. The way to eliminate that message is to use a different name for the target variable.
The second warning is because you are use the CAT() function. That function does NOT trim the trailing blanks from the values. So if your 31,000 character variable contained a string on only 1000 characters it is stored with 30,000 trailing blanks. It you then try to append something to the end of those 31,000 characters and put it back into the variable whose length is only 31,000 it will get truncated. You probably meant to use CATS() function instead. That will remove trailing and leading blanks for all arguments.
But the real problem is that it looks like you are trying to stuff 10 pounds of "potatoes" into a 5 pound bag. Your list of coordinates it more than can fit into a single character variable. So don't try to fit them into a single character variable. Instead design a data structure that can actually hold the information. If you need to regenerate that long list as an output file then do that using PUT statements in a data step. Assuming those pairs of numbers are latitude and longitude numbers then you want a structure more like:
data geolist;
input lat long;
cards;
680591852 571080119
681221760 571051820
;
Which you could then use to write to a text file. So if you wanted to write them as comma separated pairs nested in square brackets. And the list of pairs separated by commas and nested in curly brackets your code might look like this.
data _null_;
file 'geolist.txt' lrecl=1000000;
set geolist end=eof;
if _n_=1 then put '{' @;
else put ',' @;
put '[' lat +(-1) ',' long +(-1) ']' @;
if eof then put '}';
run;
Result:
{[680591852,571080119],[681221760,571051820]}
... View more