DATA Step, Macro, Functions and more

Macro Error

Reply
N/A
Posts: 0

Macro Error

Hi,
i have recently moved from SAS 9.2 to 9.13 adn some of my code wont work any more. I have quite a large macro and i get an error message on the first instance of a few let functions.

Code:

data QSI_WealthSGout;
set wealthselfgenapp;
where BranchID eq &id;
run;
%let WealthSGrows=%eval(%nobs(QSI_WealthSGout)+4);


Error Message:

WARNING: Apparent invocation of macro NOBS not resolved.
WARNING: Apparent invocation of macro NOBS not resolved.
ERROR: Required operator not found in expression: %nobs(QSI_WealthSGout)+4
ERROR: The macro CREATEBOOKS will stop executing.

im thinking it may not recognise %nobs on the first loop but am slightly cluless as to why it doesnt work in a different version of SAS

Any help would be great
Cheers
Mike
Super Contributor
Super Contributor
Posts: 3,174

Re: Macro Error

Posted in reply to deleted_user
The %NOBS macro your code is executing is likely an AUTOCALL macro (or one imbedded in a %INCLUDE source code file). It's possible that you installed or defined some utility macros within your prior SAS environment and these items were not automatically promoted to your new (from your post, it appears as an older version?) SAS environment.

Suggest you review your previous SAS environment and search for the macro.

Scott Barry
SBBWorks, Inc.
N/A
Posts: 0

Re: Macro Error

thanks for that Scott, i still have access to the library of Macros i had before so that a bit strange... its someone elses code so i will have to build a work around

Cheers
Mike
Super Contributor
Super Contributor
Posts: 3,174

Re: Macro Error

Posted in reply to deleted_user
This situation should be a "take note" opportunity for others on this "line" that it's not just important to back-up your SAS data but also your SAS source code (with multiple versions to CYA), including any SAS object catalogs (INFORMATs, FORMATs, compiled SAS macros).

And you may want to just test the waters with your Stg Admin, inquiring about "how do I go about requesting that a driver/directory (file system) be restored, please - oh, yes, and how many backup-versions are maintained for my 'production' server machine?" Just a few thoughts for the morning.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 3 replies
  • 129 views
  • 0 likes
  • 2 in conversation