/******************************************************************** * NAME: sasxpip SYSTEM: MSCDC PGMR: BLODGETT * * FUNCTION: Assumes you have a SAS xport-format dataset stored in * * a .zip file. Generates code to define a p-node that unzips the * * file and sends it to a p-node which is then referenced with a * * SAS libname statement. Allows accessing it without ever having * * the unzipped file have to go to disk. * * Model by Henk Meij, CIESIN. * * NOTES: * * For sample use, see /mscdc/test/sasxpip.sas. * ********************************************************************/ %GLOBAL REVDATE; %LET REVDATE=26AUG96; *<----DATE OF LAST REVISION; /********************************************************************/ /* BEGIN MACRO DEFINITION */ /********************************************************************/ %MACRO sasxpip( zpath=%str(.), /* path for the .zip archive file */ zfile=, /* required: name of the zip file (without .zip) */ pid=&zfile, /* name of the p-node created. Defaults to name of zip file */ libref=saspipe, /* the p-node is created in &zpath: we get to name it */ debug=0); /* END */ %PUT %STR( ); %PUT ***************************************************************; %put * sasxpip macro Rev &revdate begin execution *; %put * Missouri State Census Data Center *; %PUT ***************************************************************; %PUT %STR( ); %if %quote(&zfile) eq %str() %then %do; %put; %put ***sasxpip: Required parm zpath was not specified*** ; %goto endmac; %end; x "cd &zpath"; %*--change to dir with zip file in it--; x "rm &pid"; %*--in case its a rerun delete the p-node--; x "mknod &pid p"; %*--so you can create it fresh--; %* "(unset noclobber; unzip -cqq &zfile..zip > &pid &)"; %*--the key stmt!; x "unzip -cqq &zfile..zip > &pid &"; %*--the key stmt!; libname &libref xport "&pid"; %endmac: %mend sasxpip;