BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
misha2
Fluorite | Level 6

I'm trying to use a macro (relrisk9) to conduct a binomial log regression, but cannot seem to invoke the macro! 

The folder path I've used is taken straight from SAS, so I don't see how that could be what's wrong, although it appears to be the most common cause of this warning?

 

CodeCodeLogLog

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Looks like you pointed the SASAUTOS option to an individual file instead of a folder.

You can fix this two ways.

1) Change the SASAUTOS option to point to DIRECTORY where you have placed the relrisk9.sas file.

2)  Don't use autocall. Just use %INCLUDE to include the file with the macro definition.

 

View solution in original post

6 REPLIES 6
Tom
Super User Tom
Super User

Looks like you pointed the SASAUTOS option to an individual file instead of a folder.

You can fix this two ways.

1) Change the SASAUTOS option to point to DIRECTORY where you have placed the relrisk9.sas file.

2)  Don't use autocall. Just use %INCLUDE to include the file with the macro definition.

 

misha2
Fluorite | Level 6

Hi there,

 

Removing relrisk9.sas from the file path (to run the code below instead) still produces the warning. Is this what you meant or did I misunderstand?

 

proc options option = macro;
run;

options nocenter ps=78 ls=132 replace formdlim='='
mautosource
sasautos=('/usr/local/channing/sasautos',
'/folders/myfolders/macros');

%relrisk9(DATA=NZHS.USEME, DEPEND=obese, INDEPEND=incomeorder);

Tom
Super User Tom
Super User

Since you already failded to find it once SAS is probably not looking for it again.  You could set the MRECALL option.

Or just restart a new SAS session and try the code again.

 

Also make sure that the filename is all lower case letters.  Autocall is looking for 'relrisk9.sas' and will ignore files in mixed or uppercase. such as 'Relrisk9.sas' or 'RELRISK9.SAS'.

 

misha2
Fluorite | Level 6

I've tried both restarting the session & the mrecall function, but to no luck.

Screen Shot 2018-07-25 at 1.47.22 pm.png

The file name is relrisk9 so it's definitely not the case where we're falling over.

 

P.s. Thank you so much for your help! I'm sorry to keep replying by saying it's not working, I've been grappling with this for a day to no avail. The particularly frustrating thing is that it was working a few days ago and I have no clue what I've changed!

misha2
Fluorite | Level 6

I've been able to get %include to work instead!

 

Thank you so much for your time and expertise. 🙂

nkach
Calcite | Level 5

I am trying to run %pshreg and keep getting this error.

%PSHREG (DATA=HOSP15x,
TIME= TTH,
CENS= censor,
FAILCODE= 1,
CENCODE= 0,
VARLIST= NON_SEL AGECLASS SEX_IDENT_CD RACE AIM3 ANXIETY3 BPD3 GERD3 INSOMNIA3 IBS3 MS_LBP3 NP3 SCHIZO3  SEC_PARK3 BPH3 CC3 EPILEPSY3 DELIRIUM3 PRI_FALL_FRAC3 MG3 GLAUCOMA3 PARKINSON3 MI3 SYNCOPE3 UTI3 SKIN3 VULVO3 CHD3 THROMBO3 CEREBRO3 COPD3 RENALDIS3 GASTRIC3 CATA3 OP3 DYS3 PNEU3 ENDO3 SUICIDE3 EPS3 PRIHOSP ANTIHYPERTENSIVE1 ANTIANGINAL1 ANTIARRHYTHMIC1 OTHER_CV1 ANTIDIABETIC1 ANTIHYPERLIPIDEMIC1 ANALGESICS1 ESTROGEN1 ANTIHISTAMINE1 GI_AGENTS1 ANTICOAGULANT1
HEMOPOIETIC1 HEMATOLOGIC1 CORTICOSTEROIDS1 BRONCHODILATORS1 ANTIFUNGAL1 ANTI_INFECTIVE1 URIN_ANTI_INFECTIVE1 ANTINEOPLASTICS1 ULCER_DRUGS1 OPTH_OTIC_NASAL1 THYROID_AGTS1 HYP_SED_SLEEP1 ENDOCRINE1 ANTIDEPRESSANTS1 ANTIANXIETY1 ANTICONVULSANT1 ANTIMANIC1 STIMULANTS1 ACHEI1 MEMANTINE1 ACH_LEVEL2 SCORE,


CLASS= NON_SEL AGECLASS SEX_IDENT_CD RACE AIM3 ANXIETY3 BPD3 GERD3 INSOMNIA3 IBS3 MS_LBP3 NP3 SCHIZO3 SEC_PARK3 BPH3 CC3 EPILEPSY3 DELIRIUM3 PRI_FALL_FRAC3 MG3 GLAUCOMA3 PARKINSON3 MI3 SYNCOPE3 UTI3 SKIN3 VULVO3 CHD3 THROMBO3 CEREBRO3 COPD3 RENALDIS3 GASTRIC3 CATA3 OP3 DYS3 PNEU3 ENDO3 SUICIDE3 EPS3 PRIHOSP

ANTIHYPERTENSIVE1 ANTIANGINAL1 ANTIARRHYTHMIC1 OTHER_CV1 ANTIDIABETIC1 ANTIHYPERLIPIDEMIC1 ANALGESICS1 ESTROGEN1 ANTIHISTAMINE1 GI_AGENTS1 ANTICOAGULANT1
HEMOPOIETIC1 HEMATOLOGIC1 CORTICOSTEROIDS1 BRONCHODILATORS1 ANTIFUNGAL1 ANTI_INFECTIVE1 URIN_ANTI_INFECTIVE1 ANTINEOPLASTICS1 ULCER_DRUGS1 OPTH_OTIC_NASAL1 THYROID_AGTS1 HYP_SED_SLEEP1 ENDOCRINE1 ANTIDEPRESSANTS1 ANTIANXIETY1 ANTICONVULSANT1 ANTIMANIC1 STIMULANTS1 ACHEI1 MEMANTINE1 ACH_LEVEL2,
CUMINC= 1 ,
OPTIONS= rl);

 

I keep getting this log - 


1938 %PSHREG (DATA=HOSP15x,
-
180
WARNING: Apparent invocation of macro PSHREG not resolved.
ERROR 180-322: Statement is not valid or it is used out of proper order.
1939 TIME= TTH,
1940 CENS= censor,
1941 FAILCODE= 1,
1942 CENCODE= 0,
1943 VARLIST= NON_SEL AGECLASS SEX_IDENT_CD RACE AIM3 ANXIETY3 BPD3 GERD3 INSOMNIA3 IBS3 MS_LBP3
1943! NP3 SCHIZO3
1944 SEC_PARK3 BPH3 CC3 EPILEPSY3 DELIRIUM3 PRI_FALL_FRAC3 MG3 GLAUCOMA3 PARKINSON3 MI3 SYNCOPE3
1944! UTI3 SKIN3 VULVO3
1945 CHD3 THROMBO3 CEREBRO3 COPD3 RENALDIS3 GASTRIC3 CATA3 OP3 DYS3 PNEU3 ENDO3 SUICIDE3 EPS3
1945! PRIHOSP ANTIHYPERTENSIVE1 ANTIANGINAL1
1946 ANTIARRHYTHMIC1 OTHER_CV1 ANTIDIABETIC1 ANTIHYPERLIPIDEMIC1 ANALGESICS1 ESTROGEN1
1946! ANTIHISTAMINE1 GI_AGENTS1 ANTICOAGULANT1
1947 HEMOPOIETIC1 HEMATOLOGIC1 CORTICOSTEROIDS1 BRONCHODILATORS1 ANTIFUNGAL1 ANTI_INFECTIVE1
1947! URIN_ANTI_INFECTIVE1 ANTINEOPLASTICS1
1948 ULCER_DRUGS1 OPTH_OTIC_NASAL1 THYROID_AGTS1 HYP_SED_SLEEP1 ENDOCRINE1 ANTIDEPRESSANTS1
1948! ANTIANXIETY1 ANTICONVULSANT1 ANTIMANIC1
1949 STIMULANTS1 ACHEI1 MEMANTINE1 ACH_LEVEL2 SCORE,
1950 CLASS= NON_SEL AGECLASS SEX_IDENT_CD RACE AIM3 ANXIETY3 BPD3 GERD3 INSOMNIA3 IBS3 MS_LBP3 NP3
1950! SCHIZO3
1951 SEC_PARK3 BPH3 CC3 EPILEPSY3 DELIRIUM3 PRI_FALL_FRAC3 MG3 GLAUCOMA3 PARKINSON3 MI3 SYNCOPE3
1951! UTI3 SKIN3 VULVO3
1952 CHD3 THROMBO3 CEREBRO3 COPD3 RENALDIS3 GASTRIC3 CATA3 OP3 DYS3 PNEU3 ENDO3 SUICIDE3 EPS3
1952! PRIHOSP ANTIHYPERTENSIVE1 ANTIANGINAL1
1953 ANTIARRHYTHMIC1 OTHER_CV1 ANTIDIABETIC1 ANTIHYPERLIPIDEMIC1 ANALGESICS1 ESTROGEN1
1953! ANTIHISTAMINE1 GI_AGENTS1 ANTICOAGULANT1
1954 HEMOPOIETIC1 HEMATOLOGIC1 CORTICOSTEROIDS1 BRONCHODILATORS1 ANTIFUNGAL1 ANTI_INFECTIVE1
1954! URIN_ANTI_INFECTIVE1 ANTINEOPLASTICS1
1955 ULCER_DRUGS1 OPTH_OTIC_NASAL1 THYROID_AGTS1 HYP_SED_SLEEP1 ENDOCRINE1 ANTIDEPRESSANTS1
1955! ANTIANXIETY1 ANTICONVULSANT1 ANTIMANIC1
1956 STIMULANTS1 ACHEI1 MEMANTINE1 ACH_LEVEL2,
1957 CUMINC= 1 ,
1958 OPTIONS= rl);

 

I dont know how to use %include that you mentioned above. Could you please kindly help?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

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
  • 6 replies
  • 5121 views
  • 0 likes
  • 3 in conversation