Skip to Main Content

Useful SAS Macros%net_get

Download a package of files from a web server to your local computer

Description

The %net_get macro will download a package over the internet and install it on your local computer. A
package is simply a list of files available at a web site, and would typically be composed of a SAS macro (e.g.
test.sas), a help file for the macro 
(e.g. test.hlp), and possibly one or more supplemental files (e.g. hsb2.sas7bdat). Once you have used
%net_get to download
a macro, you can then immediately use that macro. Also, if the macro contains a help file, you can get help on using the macro using the
%local_help macro, for example %local_help( test ) .

Syntax

%net_get( package_name [ url , data_loc , replace=yes ) ]

Examples

To download test from https://stats.idre.ucla.edu/stat/sas/macros you can type

%net_get( test , https://stats.idre.ucla.edu/stat/sas/macros )

To download srs from https://stats.idre.ucla.edu/stat/sas/macros , after having issued to above command and defaulting to the same url, you can type

%net_get( srs )

To download srs from https://stats.idre.ucla.edu/stat/sas/macros again and replace the existing version, you can type

%net_get( srs, replace=yes )

To download test from https://stats.idre.ucla.edu/stat/sas/macros and to include the supplemental data files to
c:myfiles, you can type

%net_get( test, , c:myfiles )

or if you want to explicitly name the url you can type

%net_get( test , https://stats.idre.ucla.edu/stat/sas/macros , c:myfiles )

Also See

Also see the help for %net_list and
%net_describe