BookmarkSubscribeRSS Feed
alisio_meneses
Quartz | Level 8

Hello there.

 

Is it possible to use this PROC inside a code transform in Data Studio (Something like the following code)?

 

proc tsmodel data={{_dp_inputCaslib}}.{{_dp_inputTable}} seasonality=7 
		outarray={{_dp_outputCaslib}}.{{_dp_outputTable}}(replace=YES);
	by var1 var2;
	id data interval=Day setmissing=0 FORMAT=_DATA_;
	var var3 / accumulate=total;
run;

The documentation clearly states that CASL and DATA Step code languages are available to use, but as a noob I still struggle to identify which is which.

 

Thank You!

 

 

4 REPLIES 4
SASKiwi
PROC Star

If the code runs fine in a "normal" SAS Studio session then I'd say yes. In any case no harm in trying.

alisio_meneses
Quartz | Level 8
Hi SASKiwi. Thanks for your reply. Just tested the code in a Data Studio code transformation. The plan executed without complaints but the session table did not show the proc result and kept the same table from the previous transformation. Any tips on what am I doing wrong?
LinusH
Tourmaline | Level 20

Please attach the log, and maybe a print screen about the session table.

Data never sleeps
alisio_meneses
Quartz | Level 8

Sure thing. Here you go.

 

The screenshot below was taken after "successfully" running the code transform. By "successfully" I mean the plan ran without errors (log attached) but the session table didn't change. The expected result is shown on the next screenshot.

alisio_meneses_0-1668768258552.png

The screenshot below was taken in SAS StudioV and shows the expected result. This is the table I was expecting to see when running the code transform in the Data Studio plan.

alisio_meneses_1-1668768508555.png

 

This is the code inside the transform:

/* BEGIN data step with the output table data */
data {{_dp_outputTable}} (caslib={{_dp_outputCaslib}} promote="no");
/* Set the input set */
set {{_dp_inputTable}} (caslib={{_dp_inputCaslib}} );
/* END data step run */
run;

proc means nway order=freq missing;proc means nway order=freq missing;
   class country;
   freq num_sold;
   output out={{_dp_outputCaslib}}.{{_dp_outputTable}}(drop=_type_ index=(country)) / levels;
run;

Dataset used for testing: train.csv 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1315 views
  • 0 likes
  • 3 in conversation