sas >> Variable has never been referenced error.

by Jumbo Shrimps, Jr. » Thu, 15 Feb 2007 19:19:43 GMT

I read in file on a mainframe MVS system
and now I'm trying to summarize the data
in Macro SUMM to OUT1.A
SASLOG below indicates some variables are
out of order?

361 PROC SUMMARY DATA=TEMP;
362 CLASS SEQ PROD PLUNTYPE VINTAGE;
363 VAR ACCT NEWADV BALANCE NETBAL CASHFL INC_FC INC_SC INC_LC
INC_MF
(... bunch of variables from line 363 to 369. My original varlist of
variables includes all variables in this list.)
369 FRMADV FRMACCT VRM1ADV VRM1ACCT VRM2ADV VRM2ACCT PLADV
PLACCT
370 ;
371 OUTPUT OUT=OUT1.A SUM=;
372 RUN;
373
374 %MEND;
375
376 %SUMM;
ERROR: THE VARIABLE ACCTSEQ IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ACCTSEQ IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ACCTSEQ IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
ERROR: THE VARIABLE ACCTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ACCTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ACCTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
ERROR: THE VARIABLE VINTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE VINTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE VINTAGE IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
ERROR: THE VARIABLE PC_INT IN THE DROP, KEEP, OR RENAME LIST HAS NEVER BEEN
REFERENCED.
+ERROR: THE VARIABLE PC_INT IN THE DROP, KEEP, OR RENAME LIST HAS NEVER BEEN
REFERENCED.
+ERROR: THE VARIABLE PC_INT IN THE DROP, KEEP, OR RENAME LIST HAS NEVER BEEN
REFERENCED.
ERROR: THE VARIABLE ORIGSEC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER BEEN
REFERENCED.
+ERROR: THE VARIABLE ORIGSEC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ORIGSEC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
ERROR: THE VARIABLE ORIGSRC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ORIGSRC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
+ERROR: THE VARIABLE ORIGSRC IN THE DROP, KEEP, OR RENAME LIST HAS NEVER
BEEN REFERENCED.
NOTE: THE SAS SYSTEM STOPPED PROCESSING THIS STEP BECAUSE OF ERRORS.

NOTE: SAS SET OPTION OBS=0 AND WILL CONTINUE TO CHECK STATEMENTS. THIS MAY
CAUSE NOTE: NO OBSERVATIONS IN DATA SET.
WARNING: THE DATA SET WORK.TEMP MAY BE INCOMPLETE. WHEN THIS STEP WAS
STOPPED THERE WERE 0 OBSERVATIONS AND 0 VARIABLES.



sas >> Variable has never been referenced error.

by jim4stat » Thu, 15 Feb 2007 20:14:34 GMT


Hi Jumbo,

You did not show the start of a data step or some KEEP, DROP or RENAME
statement that is before he PROC SUMMARY, but your dataset TEMP is
completely empty as can be seen at the end of your log snippet.

Regards - Jim.
On Feb 15, 12:19 pm, "Jumbo Shrimps, Jr." < XXXX@XXXXX.COM >

Similar Threads

1. Hello I am having a date Problem

Hello all I am running a SAS/AF application verything in Program works
well expect for that I have to manually change the date every other
day actually Program has been  return by somebody and I am doing
documentation his code looks like this,

 %LET PGM= ;
DATA A.STATUS; 
         SET A.STATUS; 
         DROP DATE;
         IDATE=NXDATE;
         NXDATE=NXDATE2;
STATUS=MIN(STATUS,2);

SET B.PAYMENT(FIRSTOBS=3 OBS=3 KEEP=DATE);
                         NXDATE2=DATE;
IF MONTH(IDATE) EQ 9 AND MONTH(NXDATE) EQ 10 THEN DO;
                            FY=SUBSTR(PUT(YEAR(IDATE)+1,4.),4);
                            TNUM=(FY*1000)+1;
CALL SYMPUT('PGM','%INC "E:\I\S\FYINT.SBR";');
                           RCNUM=FY*100;
               END;
               RUN;
                             &PGM;

            %INC 'E:\I\S\LQRSTART.SBR';

            DATA A.OTHER;
              SET A.OTHER;
              DROP IDATE;
              IF _N_=1 THEN SET A.STATUS(KEEP=IDATE);
              DATE=IDATE; RUN;

               DATA A.ADDOWEPR;
                SET A.ADDOWEPR(OBS=0); RUN;

                DATA A.NEGHOLD;
                 SET A.NEGHOLD(OBS=0); RUN;

  DATA A.BCOLLECT(LABEL=CURRENT INV DATE LOCKBOX COLLECTIONS);
   SET  A.BCOLLECT;                                             
                 IF _N_=1 THEN SET A.STATUS(KEEP=IDATE); DROP IDATE;
                 DATE=IDATE; RUN;

                DATA A.RCOLLECT(LABEL=FUND TRANSFERS );
                 SET A.STATUS(KEEP=IDATE);
                  KEEP RBANK IDATE C1-C%EVAL(&PRGNUM) COLLECT;
                  LENGTH RBANK 3;
                 FORMAT C1-C%EVAL(&PRGNUM) COLLECT COMMA13.2; 
                 RENAME IDATE=DATE;
                  ARRAY C C1-C%EVAL(&PRGNUM) COLLECT;
                  DO O=1 TO OTOBS;
                  SET A.OTHER POINT=O NOBS=OTOBS;
                  OUTPUT;
                  END; RUN;

            PROC MEANS NOPRINT;
           VAR C1-C%EVAL(&PRGNUM) COLLECT;
            OUTPUT OUT=A.RCOLLSUM(DROP=_FREQ_ _TYPE_)
                                              SUM=RC1-RC%EVAL(&PRGNUM)
RCOLLECT;
                RUN;                                     

            %INC 'E:\I\S\LABEL.SBR';    

            PROC DATASETS DDNAME=WORK MT=DATA  NOLIST  KILL;
            RUN;
            QUIT;
            DM 'LOG;
           
I do not see any Sas code a.status or B.payments Only other Code I
found is


***  \I\AUTOCALL\INIT.SAS ;
%MACRO INIT;
**  COPY FILES FROM PREVIOUS INVESTMENT DATES SASDAILY DIRECTORY TO
    SASFILE DIRECTORY FOR CURRENT DATES INVESTMENTS;
PROC COPY IN=A OUT=B;
   SELECT T; RUN;

**  CHANGE DATES STORED IN STATUS DATASET;
**  FUTURE  DATE IS FOUND IN IMPUTED PAYMENT DATASET;
DATA A.STATUS; SET A.STATUS; DROP DATE; INITIAL=1;
   LENGTH PRDATE5 PRDATE4 PRDATE3 4.;
   FORMAT PRDATE5 PRDATE4 PRDATE3 MMDDYY8.;
   INFORMAT PRDATE5 PRDATE4 PRDATE3 MMDDYY8.;
   PRDATE5=PRDATE4; PRDATE4=PRDATE3; PRDATE3=PRDATE2;
   PRDATE2=PRDATE; PRDATE=IDATE; IDATE=NXDATE; NXDATE=NXDATE2; TNUM+1;
   WKDY=TRIM(PUT(IDATE,WEEKDATE9.)) || ', ' || PUT(IDATE,MMDDYY8.);
   SET B.PAYMENT(FIRSTOBS=3 OBS=3 KEEP=DATE); NXDATE2=DATE; RUN;

%MEND;

2. I am getting ERROR : Unable to clear or re-assign the library

3. Direct references to a variable based on value of another variable

My main dataset ONE, with 20,000 records from a survey taken in the
year 2005, includes variables CODE, UNIT, and QUANTITY.  In 2005, UNIT
may take value 1, 2, or 11, in which case I know that a second dataset
TWO includes variables CODE, CF1, CF2, and CF11.  Dataset TWO has one
record per value of CODE, where CODE takes integer values between 1 and
5000 but only about 300 values are actually used.

For a particular record on ONE, suppose that CODE=235, UNIT=11, and
QUANTITY=25000.  Other records also have CODE=235, but UNIT=1 and
UNIT=2 for some of those records.  I want to define a variable FACTOR
and assign its value by going to the record on TWO where CODE=235 and
using the value of CF1, CF2, or CF11 as appropriate.  In this example,
since UNIT=11 I need FACTOR=CF11 (say 3.25).  I can then calculate
TOTAL= QUANTITY*FACTOR.

I know two methods to solve this problem.  One approach creates
variables CF3, CF4, etc. so that I can define ARRAY CF CF1-CF11 and
then refer to CF11 as the 11th member of the array if UNIT=11.  The
second method uses Proc Transpose to create variable CF on both files
with values CF1, CF2, and CF11 and then SQL.

However, I was wondering whether there is a more direct method that
avoids the trick in the first method (creating variables not actually
on the dataset) and Transpose in the second method (I find Transpose a
bit mysterious and typically need a trial and error approach to obtain
the correct results).  My attempts to use SYMPUT and SYMGET have failed
so far due to the distinction between a variable name and its value.
That is, converting value 11 of UNIT in ONE to a macro variable named
CF11 is easy, but how do I bring in the value of CF11 from TWO?
Thanks.
Dan Milkove

4. Removing single quotes in a Variable having Organization name

5. Estimating mean of variable having inflated ZEROS

Hi there.
 I want some suggestions about the following problem:
I have a variable wich contain a lot of zero ( like 66% of zero), if I ake
off the zeros ,the variable seems normaly distributed.
The variable is like having NO debt ( then =zero) or having debt(could be
positive or negative.)
What I want is to estimate the mean of debt.
 Yes, I can use proc means, the easy way.
But, I'm wondering if I should take into compte this inflation of zeros as
expression of some hiden phenomena.
Then I could use Proc NLMIXED:

        proc nlmixed data=ONE MAXITER=10000    ;
parms p0= 0.866 A0=6000 sigma= 37800;

  mu=A0;
if debt=0 then prob = p0 +(1-p0)*pdf('NORMAL',debt,mu,sigma);
else   prob = (1-p0)*pdf('NORMAL',debt,sigma);
      if (prob > 1e-8) then loglike = log(prob);
      else loglike = -1e10;
model &depvar ~ general(loglike);

Thank you in advance for any suggestion.

Haman.

6. How to display the variables having in dataset "X" but not in

7. ERROR when referencing the RENAME function in the %SYSFUNC

I don't think RENAME is a function.  It's a SAS language statement.  Unless
I'm confused, which I may be.

-Joe

On Tue, Dec 8, 2009 at 2:59 PM, Anaconda < XXXX@XXXXX.COM > wrote:

> Here is a macro to read CVS-files into datasets:
>
> %macro readcsv(dir);
>    %local fileref rc did didc;
>    %let rc = %sysfunc(filename(fileref, &dir));
>    %let did = %sysfunc(dopen(&fileref));
>    %if &did = 0 %then %do;
>        %put ERROR: The following directory does not exist: &dir;
>        %put ERROR- The macro will terminate.;
>        %return;
>    %end;
>    %let dnum = %sysfunc(dnum(&did));
>    %do dmem = 1 %to &dnum;
>        %let memname = %sysfunc(dread(&did, &dmem));
>        %if %upcase(%scan(&memname, -1, .)) = CSV %then %do;
>            %let dsn = %scan(&memname, 1, .);
>
>            %if %sysfunc(exist(&dsn)) %then %do;
>                %let newname = &dsn._%sysfunc(today(), date9.);
>
>                %let rename = %sysfunc(rename(work.&dsn, &newname));
>            %end;
>            proc import
>                    datafile    =   "&dir\&memname"
>                    out         =   &dsn
>                    dbms        =   csv replace
>                ;
>                getnames    =   yes;
>                datarow     =   2;
>            run;
>            proc print data = &dsn;
>                title "Data Imported From &dir\&memname";
>            run;
>
>        %end;
>    %end;
>    %let didc = %sysfunc(dclose(&did));
>    %let rc = %sysfunc(filename(fileref));
> %mend readcsv;
>
> %readcsv(D:\SAS_KODE\k_makro_vg\programfiler\C3)
>
> Unfortunately, I get an error message in the SAS log from the second
> time I submit the call to the macro %READSCV. The error does not
> appear the first time I submit the code. The logic in the code is to
> rename eventually existing data set before reading in the data set
> once more.
>            %if %sysfunc(exist(&dsn)) %then %do;
>                %let newname = &dsn._%sysfunc(today(), date9.);
>
>                %let rename = %sysfunc(rename(work.&dsn, &newname));
>
> I don't understand this error message shown below:
>
> 181  %readcsv(D:\SAS_KODE\k_makro_vg\programfiler\C3)
> ERROR: The RENAME function referenced in the %SYSFUNC or %QSYSFUNC
> macro function is not found.
>
> I would appreciate if someone could explain why the error appears.
>
> - Anaconda
>

8. ERROR when referencing the RENAME function in the %SYSFUNC macro function