Help using Base SAS procedures

WARNING: out of range

Reply
Regular Contributor
Posts: 161

WARNING: out of range

hello,

I am getting this warning would someone please help me figure out why
thanks

WARNING: Argument 2 to function GETVARN referenced by the %SYSFUNC or %QSYSFUNC macro function is out of range

thank

R.A.G.
Regular Contributor
Posts: 161

Re: WARNING: out of range

Also this is my code
Thanks
R.A.G.

%MACRO SaveItemOrder;
%let num_skills=3;
%let numatt=3;
%let numitem=35;
%let numclass=%eval(2**&num_skills);
%let IDname=num_student;

DATA _NULL_;
/* Datasets to draw values from*/
%LET dataQmatrix=%SYSFUNC(OPEN(work.Qmatrix,i));
%DO i=1 %TO &NUMITEM;
/* Assign new macro variables as global*/
%GLOBAL itemorder&i;
/* Gets entire row of data*/
%LET row=%SYSFUNC(FETCHOBS(&dataQmatrix.,&i.));
/* Grabs specific value for threshold from that row*/
%LET item&i.=%SYSFUNC(GETVARN(&dataQmatrix.,
%SYSFUNC(VARNUM(&dataQmatrix.,itematt&num_skills))));
/* Transferring value to global macro, and checking via log;*/
%LET itemorder&i. = &&item&i.;
%PUT itemorder&i. &&itemorder&i.;
%END;
/* Close dataset used in program;*/
%LET dataQmatrix=%SYSFUNC(CLOSE(&dataQmatrix.));
RUN;
%MEND;
%SaveItemOrder;
Regular Contributor
Posts: 161

Re: WARNING: out of range

Hello,
Just to let others who might be curious know that I have found out why I was getting "OUT OF RANGE WARNING"
The section of the code that was referring to another file had the wrong name for the variable.
Code:

%SYSFUNC(VARNUM(&dataQmatrix.,itematt&num_skills))));

itematt should have been changed to skills

have a great rest of the weekend
R.A. G.
Occasional Contributor
Posts: 7

Re: WARNING: out of range

Hi R.A. G.

Second argument of the VARNUM function must be character. for example
varnum(mydataid,'name')


http://support.sas.com/documentation/cdl/en/sclref/59578/HTML/default/a000144731.htm


Irena
Ask a Question
Discussion stats
  • 3 replies
  • 2686 views
  • 0 likes
  • 2 in conversation