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

Hi everyone, 

 

I have managed to score a table with a model. I am using big tables (many rows and columns) and thus don't want to waste time on moving unnecessary data. 

 

It appears as though the output table copies all the variables in the input table. The model only requires some of the variables from the input table. Furthermore, the output table only requires the model outcome (em_eventprobability) and an identifier.

 

Is there a way to specify the variables to output in the output table in order to spare the data replication. I will often be scoring tables in other databases and thus moving as little data as possible is ideal. 

 

The CASL code I am using is as follows:   

 

 

proc cas;

loadactionset "ds2";

ds2.runModel/
modelname="my_gradboost"
table={caslib="Public", name = "InputData"}
modelTable={caslib="Public", name="SAS_model_table"}
casOut={caslib="Public", name="OutputData"};

run;

 

Thanks in advance.

 

Kind Regards,

 

Kyle

1 ACCEPTED SOLUTION

Accepted Solutions
joeFurbee
Community Manager

Hi @Kyle4,

I received further info from a colleague. He indicates that vars= will not work in this situation as the runModel action doesn’t do the actual I/O when the DS2 program is run.

 

He also says The DROP and KEEP DS2 statements and the DROP= and KEEP= table options all should work as expected if specified in the DS2 program.

 

Finally, he mentions, In lieu of the vars= parameter, would creating a CAS view on the input table help in this situation?

 

Hope this helps.


Join us for SAS Community Trivia

SAS Bowl LIII, SAS Hackathon 2025
Wednesday, August 25, 2025 at 10 am.

View solution in original post

4 REPLIES 4
joeFurbee
Community Manager

Hi @Kyle4,

I've forwarded this inquiry on internally. We'll get back to you soon.

 

Thanks!


Join us for SAS Community Trivia

SAS Bowl LIII, SAS Hackathon 2025
Wednesday, August 25, 2025 at 10 am.
joeFurbee
Community Manager

Hi @Kyle4,

I received this input from a colleague of mine. Hope it helps!

 

A thought is to try the vars= parameter on the input table (table={caslib="public" name="inputdata" vars={"var1" "var2" "var3"}}).

 

Another is using a DROP or KEEP statement or table option in the DS2 code, if you have access to the code.

 

Thanks,

Joe


Join us for SAS Community Trivia

SAS Bowl LIII, SAS Hackathon 2025
Wednesday, August 25, 2025 at 10 am.
joeFurbee
Community Manager

Hi @Kyle4,

I received further info from a colleague. He indicates that vars= will not work in this situation as the runModel action doesn’t do the actual I/O when the DS2 program is run.

 

He also says The DROP and KEEP DS2 statements and the DROP= and KEEP= table options all should work as expected if specified in the DS2 program.

 

Finally, he mentions, In lieu of the vars= parameter, would creating a CAS view on the input table help in this situation?

 

Hope this helps.


Join us for SAS Community Trivia

SAS Bowl LIII, SAS Hackathon 2025
Wednesday, August 25, 2025 at 10 am.
Kyle4
Fluorite | Level 6
Thanks so much, Joe. I inserted a keep statement in the ep scorecode in model manager, republished and it works like a charm. Will still explore the cas views. Btw, I have learnt a lot from your online posts.

Appreciate all your feedback.

Kind Regards,

Kyle

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2345 views
  • 2 likes
  • 2 in conversation