LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (July 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 24 Jul 2002 21:52:17 -0700
Reply-To:     lalithmyneni@hotmail.com
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lalith Mohan Myneni <lalithmyneni@YAHOO.COM>
Subject:      Corrected SAS problem - suggestions / advice required
Comments: To: SAS-L@UGA.CC.UGA.EDU
Content-Type: text/plain; charset=us-ascii

Hi,

I was getting the following warning when I run my report. The code is as follows. Your suggestions/help is appreciated.

I am trying to merge three work datasets based on the no of observations with in the datasets. If only one of the sub ds(ie. ds1) has data then it shoudl get append to the main ds. I am able to get the recrds into the temporary result set(dataset) by sQL operations, but at the time of conditional merging(I am using modify here) I am getting the following errors. The code is listed below.

======================================== macro numobs1(dsn); %global dsid num1 rc; %let num1=0; %let dsid=0; %let rc=0;

data _null_; %let dsid=%sysfunc(open(&dsn)); %let num1=%sysfunc(attrn(&dsid,nobs)); %let rc=%sysfunc(close(&dsid)); %mend numobs1;

%macro numobs2(dsn); %global dsid num2 rc; %let num2=0; %let dsid=0; %let rc=0;

data _null_; %let dsid=%sysfunc(open(&dsn)); %let num2=%sysfunc(attrn(&dsid,nobs)); %let rc=%sysfunc(close(&dsid)); %mend numobs2;

%macro numobs3(dsn); %global dsid num3 rc; %let num3=0; %let dsid=0; %let rc=0;

data _null_; %let dsid=%sysfunc(open(&dsn)); %let num3=%sysfunc(attrn(&dsid,nobs)); %let rc=%sysfunc(close(&dsid)); %mend numobs3;

%macro moddsn; %if &num1 > 0 %then %do; data work.modprod; modify work.modprod work.modprod2; by pd st md; // columns %end;

%if &num2 > 0 %then %do; data work.modprod; modify work.modprod work.modprod3; by pd st md; // columns %end; %if &num3 > 0 %then %do; data work.modprod; modify work.modprod work.modprod4; by pd st md; // columns %end;

%mend moddsn;

/* (note: work.modprod is the main ds and work.modprod1 always have values in it.) */

%numobs1(&work.modprod2);

WARNING: Apparent symbolic reference WORK not resolved. WARNING: Argument 1 to function ATTRN referenced by the %SYSFUNC or %QSYSFUNC macro function is missing or out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value.

%numobs2(&work.modprod3);

WARNING: Apparent symbolic reference WORK not resolved. WARNING: Argument 1 to function ATTRN referenced by the %SYSFUNC or %QSYSFUNC macro function is missing or out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value.

%numobs3(&work.modprod4);

WARNING: Apparent symbolic reference WORK not resolved. WARNING: Argument 1 to function ATTRN referenced by the %SYSFUNC or %QSYSFUNC macro function is missing or out of range. NOTE: Mathematical operations could not be performed during %SYSFUNC function execution. The result of the operations have been set to a missing value.

%moddsn;

===== Lalith.

__________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com


Back to: Top of message | Previous page | Main SAS-L page