do loop giving an "expecting a =." error unrelated to do loop

Reply
New Contributor
Posts: 4

do loop giving an "expecting a =." error unrelated to do loop

[ Edited ]

Hello,

   I have a program that runs a macro within a macro. I have a do loop that executes and gives a variable, awvar, to plug into the macro. The macro then is trying to compare two files from consecutive years, and so merges the two years, but relabels one variable set so that they are not overwritten. However, no matter what the variable is after the variable awvar the log reports the error "Expecting a =." and the refuses to execute the rest of the rename statement. Has this ever happened to anyone else? It doesn't make any sense becuase when I enter the variables manually, the code runs fine. 

 

An example of what I am trying to say is attached. This is SAS version 9.3.

 

Thank you so much!

Attachment
Attachment
Grand Advisor
Posts: 17,325

Re: do loop giving an "expecting a =." error unrelated to do loop

How are you executing these macro's overall? Batch or %include?

 

Otherwise it's likely you have an error in your code somewhere but I can't see it given what you've provided. 

 

To debug, delete all code and add back proc by proc until you get the error. 

 

 

New Contributor
Posts: 4

Re: do loop giving an "expecting a =." error unrelated to do loop

Thanks very much for your reply!

I am using %include. And I don't think I can run proc by proc, because it
only doesn't work when I use the do loop. When I do it manually it works.
Or is there a way to step through a do loop?



##- Please type your reply above this line. Simple formatting, no
attachments. -##
Grand Advisor
Posts: 17,325

Re: do loop giving an "expecting a =." error unrelated to do loop

Try adding the LRECL option after your %include.

 

%include 'myfile.sas' /lrecl=500;
New Contributor
Posts: 4

Re: do loop giving an "expecting a =." error unrelated to do loop

No luck, unfortunately.

Grand Advisor
Posts: 17,325

Re: do loop giving an "expecting a =." error unrelated to do loop

Well given the very little you've provided I can't help beyond this. We can't even see the full do loop.

New Contributor
Posts: 4

Re: do loop giving an "expecting a =." error unrelated to do loop

[ Edited ]

I've edited the post to include the two programs. The overall program is the rim.agency.sas, which calls the awf_switchers_service program.The relevant do loop is from lines 421-454, and the error occurs during the execution of the macro awf_switchers_service. Please let me know if there's any other information that would be helpful.

 

Thanks!

Ask a Question
Discussion stats
  • 6 replies
  • 576 views
  • 0 likes
  • 2 in conversation