DATA Step, Macro, Functions and more

ERROR: Macro keyword LET appears as text.

Accepted Solution Solved
Reply
Contributor
Posts: 40
Accepted Solution

ERROR: Macro keyword LET appears as text.

Hi All,

I am facing error as below

ERROR: Macro keyword LET appears as text.

The code i have is

%let folder=/gpfs1/SP_Output/Lev1/users/l058017/search_engine_logs/;

%let sub2_l=sitename;

%let attch2="&folder.attach_brdm/attach_brdm_&sub2_l..zip" "&folder.attach_crce/attach_crce_&sub2_l..zip" "&folder.attach_crce/attach_ecps_&sub2_l..zip";

i am using this macro attch2 to send zipped files in email. This code works in base SAS and EG , However when I try to run this in batch it gives error as Macro Keyword LET appears as text.

I want attch2 to be resolved as

"/gpfs1/SP_Output/Lev1/users/l058017/search_engine_logs/attach_brdm_sitename.zip" "/gpfs1/SP_Output/Lev1/users/l058017/search_engine_logs/attach_crce_sitename.zip" "/gpfs1/SP_Output/Lev1/users/l058017/search_engine_logs/attach_ecps_sitename.zip"

Where I am commiting the mistake ??

Need suggestion please


Accepted Solutions
Solution
‎05-10-2015 06:20 PM
PROC Star
Posts: 1,090

Re: ERROR: Macro keyword LET appears as text.

Works fine for me too. You have one more attach_brdm in the result from the code than in your desired result.

View solution in original post


All Replies
Super User
Posts: 6,930

Re: ERROR: Macro keyword LET appears as text.

Please post the section of the log where the ERROR message appears, so one can see the context.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 17,784

Re: ERROR: Macro keyword LET appears as text.

If attch2 ends up being longer than 256 characters that may be the issue.

Super User
Posts: 3,102

Re: ERROR: Macro keyword LET appears as text.

I tried running your code and it works fine for me.

I'm wondering if your error is caused by code before your %LET statements. Please provide this so we can offer further advice.

Solution
‎05-10-2015 06:20 PM
PROC Star
Posts: 1,090

Re: ERROR: Macro keyword LET appears as text.

Works fine for me too. You have one more attach_brdm in the result from the code than in your desired result.

Contributor
Posts: 40

Re: ERROR: Macro keyword LET appears as text.

Yes there was an issue with the earlier statement where I missed the semicolon.

Thanks a lot Kurt, SAS Kiwi, Tom, Reeza for such valuable inputs

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 989 views
  • 6 likes
  • 5 in conversation