%Nettools is a set of SAS macro programs that will allow a SAS user to download a SAS macro program package from our web server and call the macro program immediately after. We will show a demo session installing and using %nettools.
To install the %nettools, we will have to click on the link %net tools installation program which will take us to a setup SAS macro program page. After copying and pasting the setup program into the SAS program editor, we will have to simply run it. The setup program first tries to create a default directory for storing SAS macro programs. A dialog window shown below is displayed and we will be asked if the default directory c:sasmacros is acceptable.
After we press ENTER, or type in another location, we will see a few data steps running and then another window will be displayed as shown below. At this point, we simply press ENTER and the installation is complete.
After press ENTER, the dialog window goes away and we are done with installation and are ready to use our %nettools.
We will start to list all the available SAS macro programs on our web server by simply running the following:
We will see a list of SAS macro programs in the SAS log window as shown below.
At this point, we may be interested in looking at a particular program, say grlog. We can do the following to get more information on it.
Furthermore, we can get the help file on grlog displayed in the log window.
We now know more about the program and we want to download it and run it. We can do the following.
We know that the package grlog has been downloaded successfully and now we are ready to use it. Don’t forget to press ENTER key to send the dialog window away.
We run an example shown in the help file and we get a logistic regression plot in the graph window shown below.
Getting Help Locally
Each package of a SAS macro program contains a help file for the program. Therefore, after downloading the package, we can get help locally without having a network connection. For example, we can issue the following command:
The help file will be displayed again in the log window and the %local_help can be run regardless if the machine is connected to the internet as long as the package has been downloaded. Another example, we can always get help on our %nettools, e.g. %net_list, since these programs have been downloaded during the setup process.
Downloading a SAS Data File
You can also download a SAS version 8 data file using %net_use macro program. For example, we have a sample SAS data file located in https://stats.idre.ucla.edu/stat/sas/macros, called hsb2.sasbdat. The call of %net_use shown below will download the data file and store it in SAS temporary directory WORK.
Here is what happens when we submit the program above. The dialog window is displayed informing that the data file has been downloaded successfully. And after we press ENTER key and we will see that in the Explorer window a new data file called Hsb2.