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 XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

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 XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

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 XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

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 XL, SAS Innovate 2024 Recap
Wednesday, May 15, 2024, at 10 a.m. ET | #SASBowl

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1372 views
  • 2 likes
  • 2 in conversation