Hi SAS Users,
This morning while trying to debug, I found out a problem regarding comparing the macro character value with a character value. My macro is
%let geogn_ = %substr(&outf,1,%length(&outf)-6);
data &outfm.screen12348911;
set &outfm.merge2;
if TYPE_1 = "EQ"
/*SCREEN 1*/
and INDC3 not in ('UTILS', 'BANKS', 'FINSV', 'RLEST', 'INSUR')
/*SCREEN 2*/
and MAJOR="Y"
/*SCREEN 3*/
and GEOGN = &geogn_.
/*SCREEN 4*/
and CURWS= &cur.
/*screen 7*/
and
s3 ge 0
/*SCREEN 8*/
and
(s21 ge 0 or s21 =.) and s22 ge 0
/*SCREEN 9*/
and
s2 ge 0
/*SCREEN 11*/
;
run;
The main focus there is
and GEOGN = &geogn_.
/*SCREEN 4*/
and CURWS= &cur.
/*screen 7*/
Because when I exclude these two lines of code, the code work normally
&cur. is a dimension of the macro
%macro ImportAndTranspose(
File=
, cur=
, outf=
, StartSheet=
, EndSheet=
);
The log of OPTIONS MPRINT is as below
data ARGENTINA_screen12348911;
MPRINT(IMPORTANDTRANSPOSE): set ARGENTINA_merge2;
MPRINT(IMPORTANDTRANSPOSE): if TYPE_1 = "EQ" and INDC3 not in ('UTILS', 'BANKS', 'FINSV', 'RLEST', 'INSUR') and MAJOR="Y" and
GEOGN = ARGENTINA and CURWS= ARS and s3 ge 0 and (s21 ge 0 or s21 =.) and s22 ge 0 and s2 ge 0 ;
And regarding why I put TYPE_1 = "EQ" and INDC3 not in ('UTILS', 'BANKS', 'FINSV', 'RLEST', 'INSUR') using the single quote and the double quote is to check the interchangeable of these quotes so it should not be the reason.
Apart from that , I also tried to put the quote on "&geogn_." and "&cur." but when checking the options mprint, they are wrong (just show "&geogn_." directly rather than "ARGENTINA" as I expected.
And a further question, I know the name of a dataset is limited by 32 characters, I am not sure if the name of output also being limited by 32 characters?
Can you please have a look and help me to sort it out?
Many thanks and warm regards.
... View more