BookmarkSubscribeRSS Feed
R_A_G_
Calcite | Level 5
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.
3 REPLIES 3
R_A_G_
Calcite | Level 5
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;
R_A_G_
Calcite | Level 5
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.
ariari
Calcite | Level 5
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

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 9757 views
  • 0 likes
  • 2 in conversation