Hello,
I think I have forgotten something basic. I am trying to loop through my macro code to create ten datasets. Below is my code. When I run it as is it runs fine but when I uncomment to run the macro code block then I get the missing quote error.
I am not sure how quotes work but I think SAS is adding a double quote somewhere and causing this macro to not work.
Any help appreciated. I have been manually running this 10 times )-:
Thanks!
libname data "H:\sasdata\eligibility";
options symbolgen mlogic serror merror mprint;
*%macro run_partition;
*%do ct=2 %to 4;
%let ct = 5;
%let st = &ct.000000000;
%let et = &ct.999999999;
%put &st.;
%put &et.;
%_eg_conditional_dropds(DATA.T0265_AG_IN_ELIG_P&ct);
PROC SQL;
CREATE TABLE DATA.T0265_AG_IN_ELIG_P&ct AS
SELECT
CASE_NUM
,PIN_NUM
,ELIG_RSLT_CD
,ELIGIBILITY_BEG_DT
,ELIGIBILITY_END_DT
,PAYMENT_BEGIN_DT
,PAYMENT_END_DT
FROM CKDB.T0265_AG_IN_ELIG
WHERE PIN_NUM > 0
AND PIN_NUM between &st and &et
AND CURRENT_ELIG_IND IN ('1','9')
AND PROGRAM_CD = 'CC'
AND SUBPROGRAM_CD NOT IN ('X','Z')
AND AG_SEQ_NUM > 0
AND CAG_ELIG_SEQ_NUM > 0
AND AG_STS_CD = 'O'
AND PAYMENT_BEGIN_DT <= '27nov2017'd
AND PAYMENT_END_DT >= '27nov2017'd
AND PAYMENT_BEGIN_DT <= PAYMENT_END_DT
AND PART_STS_CD = 'EA';
quit;
*%end;
*%macro run_partition;
*%run_partition
You are missing a %MEND statement for your macro:
*%mend run_partition;
You are missing a %MEND statement for your macro:
*%mend run_partition;
Hello,
I am wondering now why it is not looping through 0 through 9 when I open up this macro statement:
%do ct=0 %to 9;
Comment or remove this statement:
%let ct = 5;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.