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 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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