Invoking a class method from within submit block in SCL

Reply
Occasional Contributor
Posts: 11

Invoking a class method from within submit block in SCL

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

Valued Guide
Posts: 3,206

Re: Invoking a class method from within submit block in SCL

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 --<-----
Occasional Contributor
Posts: 11

Re: Invoking a class method from within submit block in SCL

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

Valued Guide
Posts: 3,206

Re: Invoking a class method from within submit block in SCL

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 --<-----
Occasional Contributor
Posts: 11

Re: Invoking a class method from within submit block in SCL

OK thanks for clearing that up Smiley Happy

Ask a Question
Discussion stats
  • 4 replies
  • 189 views
  • 0 likes
  • 2 in conversation