Hello,
Sorry for my late reply. It was late night here in Taiwan then.
I think I've successfully logged into SAS Studio, but I don't know whether merely SAS Studio will work, or I need another thing called "SAS Studio V."
Thank you for your information. I thought I could only use Jupyter Notebook with SAS Viya trial. It's good to know that I don't 😆
Hello,
Hopefully you will get this before the weekend, there in Taiwan.
SAS Studio V is just the version number. I am running Release: 5.2.
Here's what you do in SAS Studio:
cas mySession sessopts=(caslib=casuser timeout=1800 locale="en_US");
caslib _all_ assign;
libname mycas cas caslib='casuser';
data mycas.my_data_set_in_memory;
set mylib.my_data_set_on_disk;
run;
PROC CPANEL data=mycas.my_data_set_in_memory ...
...
run;
/* end of program */
Good luck,
Koen (Brussels area, Belgium)
Hello Koen,
I ran the code on SAS Studio and errors showed up.
Do I need to do something to tell SAS Studio that I want to use SAS Viya?
I just googled "SAS Studio", logged into my SAS account, and opened SAS Studio. Is there anything I need to do before running the code?
Hello,
It should work.
I hope your SAS Studio is approaching SAS VIYA and not SAS 9.4Mx.
Can you click on your profile icon in the top-right corner and select "about"?
It should give you a VIYA version.
For me it says (it's the server of the customer I'm now working for):
Cheers,
Koen
Hi,
I think there isn't a profile button on my SAS Studio user interface.
This is how my SAS Studio looks like: (I'm sorry that it's automatically in Chinese for some reason)
The top-right button is just a log-out button (登出).
The email I received right after I signed up for SAS Viya trial is here:
As I click on Log in to your Trial Portal, it directs me to Jupyter Notebook. I hope that this portal is not the only way I can use Viya trial.
I think the main problem is that SAS Studio doesn't know I signed up for Viya trial. Do you know how to fix this?
Hello Koen,
I tried to run your code on the portal link I got (Jupyter Notebook), and the first three lines worked perfectly, so I think I can run SAS code on the Jupyter Notebook. There's no need to be familiar with python.
However, before I run PROC CPANEL, I have to "upload" the file in my computer to the CAS in-memory. How can I achieve that?
Hello @YIN_YI_JEN ,
You need to put your file (analysis dataset) on the server. Using WinSCP for example (binary transfer!). Or any other (S)FTP-tool.
Suppose you put your file in:
/opt/demodata/data_Yin_Yi_Jen
and suppose the data file is named "my_data_on_disk.sas7bdat".
Then this is the code you need:
libname mylib "/opt/demodata/data_Yin_Yi_Jen";
libname mycas cas caslib='casuser';
data mycas.my_data_set_in_memory;
set mylib.my_data_set_on_disk;
run;
If you don't know how to use (S)FTP, you can also upload in SAS Studio (from your PC / laptop).
Just make a permanent library "mylib". Right click on the library and select "Upload". There are other ways in SAS Studio but that's by far the most easiest route.
Hope you can be successful in the uploading. I do not know how to do the same in Jupyter Notebook.
Cheers,
Koen
Hello @YIN_YI_JEN ,
See also my previous post.
I am not sure if my previous post is appropriate as maybe you cannot use SAS Studio.
It should in any case be possible to upload local SAS datasets, as your "welcome-to-trial" e-mail mentions:
I do not know anything about the SAS-environment that has been made available to you for the trial. Haven't you got a contact address in case you experience any problems?
Or maybe you could call your local Taiwan helpdesk?
Good luck,
Koen
Hello Koen,
I was using WinSCP to connect to the server, but I don't know the name of the server hosting my SAS Viya trial on Jupyter Notebook, so I've send an email to SAS Technical Support to ask about this. It should work if I get the host name.
Anyway, thank you for you help. I will let you know how things are going. Have a nice weekend!
Hello Koen,
Instead of uploading my data into CAS, I "create" a data set on the server, so that I can analyze it (I'm waiting for SAS Technical Support to get back to me at the same time).
Within my Viya trial environment, I run my code as follows:
proc cpanel data=casuser.panel_data;
id firm year;
model elimat = early_refin asset leverage tbrate / ivfixtwo; /*tbrate is an interest rate that changes with time*/
endogenous early_refin;
instruments turn_call;
run;
But the log keeps saying "ERROR: Duplicated time values within cross sections. Unable to proceed."
If I drop "year" in the ID statement, it works, but I want to fix year effect as well. Do you know how I can fix this error?
Hello @YIN_YI_JEN ,
Instead of uploading your data set to the server (as you still don't know the server's address), you could also generate data step code with datalines; from your dataset with a small program (data-driven code generation). Then you copy / paste this generated data step code in the editor and submit. This way you create the table with a data step, directly on the server. Of course you should have a limited amount of rows to do this. Not feasible for 5000+ rows I would say.
Let me know if you have doubts on how to do this.
Concerning PROC CPANEL.
Here's the documentation:
https://go.documentation.sas.com/doc/en/pgmsascdc/v_010/casecon/casecon_cpanel_overview01.htm
ID cross-section-id <time-series-id>;
Year should be unique within Firm. Is that the case?
Thanks,
Koen
Hello @sbxkoenk ,
No problem with generating data sets on SAS trial so far. Thanks a lot!
I've checked if the year value is unique within every firm in my data set with the following code:
/*sort my data set by firm and year*/
proc sort data=panel_data;
by firm year;
run;
/*mark 1 if there is a year value occurring more than one time within a firm*/
data panel_data;
set panel_data;
by firm;
lag_firm=lag(firm);
lag_year=lag(year);
if first.firm then mark=0;
else if firm=lag_firm and year^=lag_y+1 then mark=1;
run;
There isn't any observation marked 1, which means there is no duplicated year value within every firm in my data set. Is there other possible reason why that error keeps showing up?
I know that in the ID statement, a time variable is optional, but I think it should not be an error if I have it there.🤔
Hello @YIN_YI_JEN ,
> a time variable is optional, but I think it should not be an error if I have it there.
No, on the contrary. If you really have PANEL data (Time Series Cross-Sectional data), you need that time-id variable. So you must put it!
I understand your code but it cannot work as lag_y probably has to be lag_year.
Anyway, I trust you have done it correctly on your trial-version.
But a better way to find out about duplicates is with a PROC FREQ.
PROC FREQ data=YOUR_LIB.YOUR_DS noprint;
tables FIRM * YEAR / out=work.count_doubles(where=(count>1));
run;
/* end of program */
I will now have a look at what else could cause your error.
Kind regards,
Koen
Hello again,
> But the log keeps saying "ERROR: Duplicated time values within cross sections. Unable to proceed."
I could not find any other explanation for your PROC CPANEL ERROR in our Technical Support data base.
As you are working with dummy data for the moment, you can always share your data with me (if you want). Then, I can have a look.
You can better do that via a private mail, I think. There's a mail option in this communities site.
if you have data step code to generate the data, then I prefer that, rather than an attachment.
Thanks,
Koen
Hello Koen,
Thank you for providing an alternative to check my data set. I've tried it, and there is no duplicates.
I've sent you a private message as well.
I really appreciate your great support 😊
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.