BookmarkSubscribeRSS Feed
Nieumysl
Calcite | Level 5

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 😕

4 REPLIES 4
jakarman
Barite | Level 11

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.

---->-- ja karman --<-----
Nieumysl
Calcite | Level 5

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...:/

jakarman
Barite | Level 11

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.

---->-- ja karman --<-----
Nieumysl
Calcite | Level 5

OK thanks for clearing that up Smiley Happy

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
  • 4 replies
  • 444 views
  • 0 likes
  • 2 in conversation