Hi,
I'm trying to invoke a method from a submit...endsubmit block in SCL - basically its something like this:
submit;
...
dict.get('TOPMENU_USER', 'EN');
...
endsubmit;
Where dist is an instance of a class which has the get method.
Is this even possible? Putting & in front of the invocation makes it look for an attribute 😕
Review the preview concepts. SAS(R) Component Language 9.4: Reference, Third Edition
Within submit endsubmit you are building up some code in a buffer to be execute by sas (datastep). Something like macro-processing.
By that invoking a method in the middle of building up that code does not make sense.
When its a procedure-type method, agreed - but what about functions? You can certainly access variables from the submit block (like, substituting &<var> with appropriate text) - wouldn't computing the function result and substituting it be somewhat the same thing? Sorry if my questions seem naive, but I'm very new to SAS and SCL and still somewhat confused with the preview concept...:/
SCL better to be associated AF is an older programming environment classified as object-oriented hyping in the start of the 1990's.
SCL is different to macro and base as it is always a compiled execution (catalog version/machine dependent).
The first replacement would be by rebuilding as java using app-dev studio (failed). By now it is more SAS-portal (BI/DI) and SAS-VA.
Some language concepts of SCL can be found in the new DS2 language. SAS(R) 9.4 DS2 Language Reference, Third Edition
A lot functions previous only did exist in SCL have been implemented in the standard base environment with 9.3.
The link to text substitution was in my previous link. SAS(R) Component Language 9.4: Reference, Third Edition
You can use scl variables and macro variables at that, but should avoid naming conflicts. You can use macro functions.
But when you are modifying the text in that buffer (dynamic code) how would you invoke a to be compiled scl function. SCL is not interpreter based, it is compiled. There is your limitation as of a basic concept.
OK thanks for clearing that up
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.