SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
braam
Quartz | Level 8

I'm wondering if there is such a thing like Juptyer-Lab (or Notebook) for SAS. Put differently, I would like to have my results or figures right after the related code. The way the blog is posted is what I would like to have: https://blogs.sas.com/content/graphicallyspeaking/2012/03/18/graphs-with-class/#prettyPhoto

 

I know there is a SAS markdown package in R, but I'm hesitating to use the package, mostly because I haven't used R. I don't think it's good to use this package with R if this is the only reason I use R.

5 REPLIES 5
Reeza
Super User

https://blogs.sas.com/content/sasdummy/2016/04/24/how-to-run-sas-programs-in-jupyter-notebook/

 

You can use Jupyter Notebooks with SAS. 

 


@braam wrote:

I'm wondering if there is such a thing like Juptyer-Lab (or Notebook) for SAS. Put differently, I would like to have my results or figures right after the related code. The way the blog is posted is what I would like to have: https://blogs.sas.com/content/graphicallyspeaking/2012/03/18/graphs-with-class/#prettyPhoto

 

I know there is a SAS markdown package in R, but I'm hesitating to use the package, mostly because I haven't used R. I don't think it's good to use this package with R if this is the only reason I use R.


 

braam
Quartz | Level 8
Thanks @Reeza. With this approach, do they work well together? Just so you know, I use macro, x statement, libname, %include, dm statement, etc. a lot. Do you think it is possible to move to Jupyter Notebook with SAS completely?
ballardw
Super User

How much work do you want to do?

I doubt is there is a setting change to make all of your output do this.

 

One approach that doesn't involve a lot of work other than your copy and paste of proc code is something like this:

 

Proc odstext;
p "Proc print data=sashelp.class;
   var sex name;
run;";

Proc print data=sashelp.class;
   var sex name;
run;

Proc odstext will create not-very-pretty text output with this simple approach but can be done relatively easy (at least until your program code has lots of quotes in it.

 

Is this supposed to be "publication quality" or just local documentation?

braam
Quartz | Level 8
Thanks @ballardw. It's only for local documentation. I code a lot, and I have to learn the same code especially when my data is updated. Every time I do, I record some important statistics, which is quite annoying. So I'm looking for alternatives. Let me try your suggestion!
Reeza
Super User

Personally, I don’t do my data wrangling in Jupyter, only my reporting to end users. I find the data wrangling part isn’t really conducive to notebooks because most of the time you have no output. 

 

You shouldn’t be recording any statistics manually. Write a process to collect the data and dump it into a data set so you can process it. 


@braam wrote:
Thanks @ballardw. It's only for local documentation. I code a lot, and I have to learn the same code especially when my data is updated. Every time I do, I record some important statistics, which is quite annoying. So I'm looking for alternatives. Let me try your suggestion!

 

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1930 views
  • 0 likes
  • 3 in conversation