I am new to SAS and I am currently trying to write a program that uses Proc SQL; to create a table. After the table is created, I am trying to call variable/fields from that table in SCL to use later. Below is the section of code that is getting the error (names of tables and variables have been changed), and the error itself. Any advice on what I'm doing wrong would be greatly appreciated. SUBMIT continue;
proc sql;
create table work.TestCount
as select * , count(*) as field3
from sasTest.table1
where field1 ne "";
quit;
endsubmit;
refTest='work.TestCount';
FieldTest=open(refTest,'u');
TestField1=getvarc(FieldTest,varnum(FieldTest,field1)); <-- ERROR IS STOPPING PROGRAM HERE
TestField2=getvarc(FieldTest,varnum(FieldTest,field2));
TestField3=getvarn(FieldTest,varnum(FieldTest,field3)); *** Line 130: [ERROR: #70] Calling function GETVARC. ERROR: Variable is not defined or does not exist. Arguments passed to GETVARC: 1 FieldTest = 3 2 (Numeric Expression $T0) = 0 Program returning prematurely at line 130
... View more