DATA Step, Macro, Functions and more

PROC LUA sas.get function not found

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 6
Accepted Solution

PROC LUA sas.get function not found

[ Edited ]

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.


Accepted Solutions
Solution
‎12-15-2016 07:51 AM
Occasional Contributor
Posts: 6

Re: PROC LUA sas.get function not found


All Replies
Solution
‎12-15-2016 07:51 AM
Occasional Contributor
Posts: 6

Re: PROC LUA sas.get function not found

The function 'sas.get' has been renamed to 'sas.get_value'. Reference: http://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#p0t7zanjrat68hn1ue4mm...
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 165 views
  • 0 likes
  • 1 in conversation