BookmarkSubscribeRSS Feed
alisio_meneses
Obsidian | Level 7

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
Opal | Level 21

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
Obsidian | Level 7
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
Obsidian | Level 7

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 262 views
  • 0 likes
  • 3 in conversation