BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
nacnudus
Fluorite | Level 6

I'm running the following code on SAS 9.4 (also tested on SAS On Demand), taken from page 8 of "Driving SAS with Lua" http://support.sas.com/resources/papers/proceedings15/SAS1561-2015.pdf.

 

proc lua;
	submit;
		local dsid = sas.open("sashelp.class")
		while sas.next(dsid) do
			print(sas.get(dsid,"name"), sas.get(dsid,"age"))
		end
		sas.close(dsid)
	endsubmit;
run;

 

 

It fails.  The log is:

 

1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 55         
 56         proc lua;
 57         submit;
 58         local dsid = sas.open("sashelp.class")
 59         while sas.next(dsid) do
 60         print(sas.get(dsid,"name"), sas.get(dsid,"age"))
 61         end
 62         sas.close(dsid)
 63         endsubmit;
 64         run;
 
 NOTE: Resuming Lua state from previous PROC LUA invocation.
 ERROR: Can't find FCMP or SAS function get
 ERROR: SUBMIT block:3: function get not found
 stack traceback:
 [C]: in function '__index'
 SUBMIT block:3: in main chunk
 ERROR: There was an error submitting the provided code
 WARNING: Closing SASHELP.CLASS - handle has gone out of scope.
 NOTE: The SAS System stopped processing this step because of errors.
 NOTE: PROCEDURE LUA used (Total process time):
       real time           0.01 seconds
       cpu time            0.01 seconds
       
 65         
 66         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 78       

 

 

Previous code examples work, but any example that uses sas.get does not work.

1 ACCEPTED SOLUTION
1 REPLY 1

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1043 views
  • 1 like
  • 1 in conversation