What is the direct procedure of opening a new notebook in SAS?

Let’s just do that actually so you can see so if I click sas under the notebook kind of area where it’s going to open a new notebook in the location that I’m in within my kind of folder structure here on the left and you can see there’s it’s hard to tell that anything actually happened but you can see a new kind of file is open it says untitled IP Y and B at the top and we have this kind of gray looking cell here at the top that I can click into if I want and things like that and again I want to point out that it says SAS in the top.

Whatever it says in the top right is kind of the kernel that’s being used as to the software language that we’ve kind of chosen to use under the hood of this notebook okay Jupiter notebooks are basically made up of cells and you can have as many cells as you want these cells can be one of a couple of different types the primary two types are the only that we’re gonna talk about today in this video you can have code cells or you can have markdown cells and with a cell kind of selected you can choose from this drop-down what kind of cell you want that to be so if you want to be a code cell then this is a cell in which you would write SAS code if you wanted it to be a markdown cell you select markdown you can see that the look of it changes a little bit and now when you type in it it’s just going to be text instead of typing anything here yet I’m just going to walk through kind of the tools and skeleton of the notebook.

We’ll go over to these pre-built notebooks that I have in the Github repository that you’ll be able to access as well there are keyboard shortcuts for everything that you can think of doing inside the Jupiter notebook but you can also kind of do everything through the menus here at the top so we have you know file edit view run all kinds of stuff up here which is really nice so it’s pretty accessible and stuff like that the main thing that I think we we’re going to want to do though is to add more cells usually Jupiter notebooks are a composition of lots and lots of different cells some code and some markdown I like to use some of the keyboard shortcuts because they’re much quicker to use if you’re a VI or vim user then you’ll be I think very happy to find out or discover that the Jupiter notebook supports a lot of the same or a few of the same than VI or vim controls that you’re used to so with nothing selected here.

The top kind of only sell here selected as indicated kind of by the blue bar there if I hit the B key it creates a new cell below b4 below the cell that was selected if I hit enter with that key selected or that cell selected I go to I go into a kind of an edit or insert mode and so now you can see that I have the freedom to kind of type into this cell notice that this cell was created with kind of a default type of code right so this is a code cell so I could type a data step you know my data step X is one run proc print data equals my data step run so this looks like you know some SAS code that you would normally see if you want to run a code cell so execute the code in that cell you can have you know to come up to the run if you want but you can see that there’s actually keyboard shortcut for that as well which is shift-enter so again with the code this cells selected.

If I hit shift enter right SAS connection establish some kind of you know behind-the-scenes information there but then directly below it below this code cell I’m seeing the output of that code cell right which is really nice so I’m seeing the results the output of my code in the line below where that code was typed and run and so again if I hit there are all kinds of shortcuts here so if you want to navigate between the cells again you can use a kind of VI or vim controls otherwise you can use the arrow keys you can use the mouse to click around in cells and we can generate as many cells as we want so I just hit be like 10 more times right to generate all these cells if I’m in this cell here and I hit an a4 above generates a cell above that particular code so okay again we can mix and match it doesn’t matter kind of what order they’re in I can make this a markdown cell right so hashtag in markdown language is kind of a header.

Num1 hash is a header of level one so this is you know my sass code demo that looks a little bit weird but if I render the cell which is the same keyboard shortcut so shipped enter that markdown actually gets rendered right now kind of on the fly and looks really good right that looks a lot better than hash my sass code demo so it’s actually being rendered as a level 1 header right and I can’t see that if I wanted to get back to that I could select that cell and hit enter or I could just double click so double left-clicking the cell also brings me back into kind of an edit mode here so that I can make changes and all that kind of stuff alright that was a lot of information really quick about like introducing you to a new notebook.

I’m gonna step over to this typesetting with Jupiter notebook that is kind of pre-populated in the collection of materials that you have access to so I’m double-clicking that – to open that you can see it’s appearing here in kind of our viewer kind of the main window just next to the previous untitled file that we had opened originally and you see there’s lots of text in here right so what I wanted to talk first with you about with without really getting into any code yet besides that example I just showed you is the typesetting right so all of these cells in a Jupiter notebook have the option to be markdown cells alright so you could just use this as a typesetting tool.

If you wanted to write markdown is a pretty simple straightforward language if you don’t know markdown or you haven’t heard of markdown all you have to do is kind of Google search markdown cheat sheet or markdown tutorials and things like that and you can do there’s some really nice kind of references out there for markdown language but what you’re seeing is kind of a rendered Jupiter notebook right but these are all markdown cells so there’s no code here and again double-clicking just lets us see what’s under the hood.

If I double click the cell you can see it’s another level one header typesetting with Jupiter notebooks and then it just looks like kind of regular text but when I hit shift enter it actually renders that cell okay again one of the biggest features that all kind of repeat lots and lots of times is that Jupiter notebooks allow you to do data science and by that I mean to include both rendered markdown text and live code along with its resulting output in the same file or location right this is that one kind of unifying tool that I was saying we want.

Before we get into programming again let’s first explore the typesetting a bit so we have lots of cells here there are a few more bits of information in this cell I’ll let you read through this on your own to explain the controls editing and all that kind of stuff and if you actually double click these you can actually see what I did to actually kind of type them right

Leave a Reply