I’m just going to my original view and remove this unconfigure node and start building my process flow from my snippets. So all I simply need to do is drag my snippets from the left into my process flow. Notice my node snippet doesn’t have that unconfigured icon in the bottom right because there is code or text associated with this node even though it is just all text, just a node. So I’m going to add in my other snippets. Now notice on the side of each program node is a control port.
These ports are used to connect one node to the other simply by selecting and dragging. This is what’s going to set the sequence of the order in which the nodes process. So I’m going to add in my other nodes and connect them in the order that I want them to process and in the order that it makes sense for my steps and statements. I can use this icon here to arrange my program nodes so that it looks a lot nicer. So my nodes are set in the sequence that I want them to run.
First my nodes, then my node to access my SAS table from a library and resort it then my imported Excel file. The results of these nodes are combined in the merge and the resulting table from the merge is used to create these reports. Now I can update the nodes individually. I can go right into a node, double click on it and run it. Now, this is just a node, so really there’s nothing here to run. But you can see that once a node runs successfully, I get the green checkmark. From this view, I can also click on a node, right-click, and run that individually. Or I can run the entire process flow in the sequence specified by going up to the top and running the entire process flow. And you can see it running in sequence. The green icon in the bottom right corner just lets you know that it’s in the queue and waiting to be run.
Obviously, once it’s successfully completed, you get the green checkmark. I can also see the success or the status of each of these nodes by clicking on Results. And here, you can see that each program node ran successfully. If I select Properties, it gives me the name of the node, the default order in which the process flow will run, which will be the priority in which I said. But notice that you can also change this to parallel. I’m going to make a few modifications to my process flow. One of them is to recreate this fit plot with a SAS-provided snippet. So I’m just going to delete this and go to My Snippets on the left. And I’m going into the SAS graph category of snippets. And I’m going to drag in the fit plot template. So let’s take a look at the template provided.
I’m just going to double-click to open up the fit plot. And as you can see, this template provided by the SAS snippet is the fit plot based on a data set in the SASHELP library. So I’m going to modify this code for my data source and my variables. So I’m going to change the title. I’m going to modify the source table for my data source. I’m going to modify the wear for my variable and values. I’m going to modify my x-axis variable again for my variable average price and my y-axis variable for my variable volume. Now notice I get an error because it looks like I’ve specified my data source incorrectly. If I go to my Process flow, you can see what a program node looks like with an error.
Let’s take a look at the work library to get the correct name of my table. So there it is. This is the correct name of the data source that I should be using, SORT_M_STOCKS_PROD. So I’m going to reopen my code. Notice that I used SORT_M_STOCKS_PROD. So I’m going to go back into my code and make the correction to the source table name. There we go. I’ve reproduced my fit plot but starting from the template provided by SAS. And now I’ll just reset the sequence I had before. Remember you can use this to arrange your program nodes. I’m going to make another modification. I’m going to go into each of these individual report nodes and remove the ODS statements. The reason I’m going to do that is that I’m going to add my final snippet, the one that exports my reports out to Excel, and that one is the one that really needs the ODS statements, not these individual ones because the individual reports are not going to be exported to Excel.
I’m simply going to go into each of these nodes, go to the code, and remove these ODS for Output Delivery System statements. So again, I’ve removed the ODS statements from each of these individual programs because it’s not needed. Those statements are only needed for this last program node that combines all those reports together and then exports them out to Excel. So this is where this ODS statement is needed. So this statement is going to export out all my reports to an Excel file called sp_reports. So we’ll take a look at it after I’ve run this node. So I’m going to run this final node. It was successfully completed and I could set the sequence going forward so that it will be the final node run.
This is the exported Excel report. So a list report was created for each company in a separate tab, the bar line graph, the fit plot, the line graph all in this Excel file. And finally, I’m going to save this process flow so that I can reuse it in the future. Notice that it saves as a .cpf file. So I’ve gone from a single tab of steps and statements to a process flow comprised of all code nodes. Now I’m going to recreate this process flow using mostly tasks. So I’m going to right-click, start a new process flow and start adding my nodes. Now I am going to add my nodes snippet because there isn’t a task for a node. A node is just code. But I am going to modify this node so that it reflects this flow that’s going to be comprised of most tasks. So modifying the purpose of this flow is to illustrate the creation of a process flow using tasks in the Visual Programmer perspective. This flow uses fictitious tables.
I’m going to add one extra modification, just a reminder to assign my library from the library’s menu. I’ll explain what I mean by this in a minute. So I have updated my node. The other thing I can do with this node to node is if I right-click, I can go into the properties and actually modify the name.