PROC SQL : Different behaviour of PROC SQL in SAS 9.1 / 9.2 and SAS 9.3

Reply
New Contributor
Posts: 2

PROC SQL : Different behaviour of PROC SQL in SAS 9.1 / 9.2 and SAS 9.3

Hi all,

I am trying to concatenate character strings to SAS variables (from a dataset with zero observations), I get different results in SAS version 9.3 than that of in SAS 9.1 and 9.2.

When I submit the following piece of code, in SAS version 9.1 or 9.2 , the result for variable filelist2  is blank, but in SAS 9.3 it concatenates the string and returns some value, which should not be the case,

as dataset range2(on which SELECT clause is applied) doesn't even have a single observation.

Is there some change in PROC SQL in SAS 9.3 ?

Any input regarding these different results are highly apprciated.

Here is the code:-

Data range2;

length file_month file_year $15.;

stop;

Run;

proc sql noprint;

select strip(compress(file_month)||compress('rtng.')||compress(file_year)||'_rtng'),

count(*)

into :filelist2 separated by ' ',:countds

from range2;

quit;

%put filelist2 ==> &filelist2;

%put countds  ==> &countds;

----------------------------------------------------------------------------------------------------------------------------

/*sas 9.3 output*/

----------------------------------------------------------------------------------------------------------------------------

   %put filelist2 ==> &filelist2;

filelist2 ==> rtng._rtng

   %put countds  ==> &countds;

countds  ==>        0

----------------------------------------------------------------------------------------------------------------------------

/*sas 9.1 and sas 9.2 output*/

----------------------------------------------------------------------------------------------------------------------------

   %put filelist2 ==> &filelist2;

filelist2 ==>

   %put countds  ==> &countds;

countds  ==>

Please provide your insights.

Thank you in advance!

Regards,

Birender

Super User
Super User
Posts: 7,403

Re: PROC SQL : Difference behaviour of PROC SQL in SAS 9.1 / 9.2 and SAS 9.3

Well, I couldn't see anything in the changes : What's New in SAS(R) 9.3

and I don't have < 9.3 installed anymore to check.  But to my mind interpretation they seem to have fixed the operation you are seeing there.  The dataset created has zero observations so count would be zero - missing seems to indicate failure, and you get some output as you have a dataline in your select.  Its odd admittedly, perhaps check with Tech Support?

New Contributor
Posts: 2

Re: PROC SQL : Difference behaviour of PROC SQL in SAS 9.1 / 9.2 and SAS 9.3

Thanks for the Reply ! yeah I did check Whats new in SAS 9.3 document, could not find anything there of that sort.

Lets see what Tech Support says regarding this.

Ask a Question
Discussion stats
  • 2 replies
  • 191 views
  • 4 likes
  • 2 in conversation