/*********************************************************************/ /* FILE is called import.sas */ /* By: Tim FJ Tolson, User Support, ITC, Univ of VA */ /* ***** See documentation/explanations below ******* (6/96) */ /*********************************************************************/ OPTIONS LINESIZE=80; TITLE 'Import SAS dataset from a transport dataset' ; TITLE2 'Transport dataset MUST have been transferred in BINARY mode'; LIBNAME saslib '.'; /* points to current directory */ LIBNAME transp XPORT 'transp.sasport'; /* transport dataset name */ PROC COPY IN = transp OUT=saslib ; /* Use "SELECT dataset name; if have several SAS membernames in */ /* the SAS library and only want to move one */ PROC CONTENTS data=saslib._all_ ; /* first check datasets */ /* You need one PROC MEANS DATA = sasdataset ; statement for EACH dataset */ PROC MEANS DATA = saslib.tests MAXDEC=4 ; /* "tests" is filename */ PROC MEANS DATA = saslib.sexmean MAXDEC=4 ; /*-------------- INTRODUCTION ---------------------------------------*/ /* */ /* To run this file, simply type: sas import */ /* and press return. You CANNOT log off while this job is running. */ /* When it is complete, the system prompt will return. You */ /* should look at the file called import.LOG to see that the */ /* job ran correctly. Then print this file and compare with the */ /* LOG from exporting. The LOG file lists, for each dataset, the */ /* number of observations and variables. You should ALSO print & */ /* check the import.LST file, which will have the results from */ /* the PROC CONTENTS and PROC MEANS. Use this file to compare to */ /* to the output from exporting the file on the old computer sys- */ /* tem. */ /* */ /* For help or questions contact the consultant for the computer */ /* on which you're working by calling 924-3731 or sending e-mail */ /* to CONSULT@virginia.edu */ /*-------------------------------------------------------------------*/ /* ---------*** EXPLANATIONS/DETAILS ***--------------------------------- */ /* */ /* The first LIBNAME statement reads all of the SAS datasets from the */ /* default (current) directory. The Second LIBNAME statement points */ /* to the directory and FILE that the transport dataset(s) will be */ /* IMPORTED from. */ /* If there are more than one dataset in the transport file than all */ /* the datasets will be written onto the default directory. If you */ /* only want to read in one dataset, use the SELECT option on the */ /* PROC COPY command. */ /* If there are datasets in other directories, use additional LIBNAME */ /* statements to point to those directories and use additional LIBNAME */ /* statements to point to additional transport files and then issue */ /* additional PROC COPY commands. */ /* */ /* *** VERIFYING and CHECKING your data for transfer: */ /* The PROC CONTENTS lists all the information about the dataset. */ /* It gives the number of cases and variables, the variable names, type, */ /* any formats, informats, and labels. */ /* PROC MEANS gives the Mean, Standard Deviation, Minimum & Maximum */ /* value for each variable in the dataset. */ /* Use these two pieces of output to compare the new dataset to the data */ /* set BEFORE you exported from your old computer system to make sure */ /* the data tranferred correctly. It's one in 10,000 that it does not, */ /* but you don't want to be the one! */ /* */ /* ------------------- ---------------- */ /* **** IMPORTANT TRANSFER INFORMATION **** */ /* After you created the SAS transport dataset on your old computer, you */ /* moved it to a new computer system. They transfer MUST BE MADE in */ /* BINARY MODE! */ /* If you use FTP, at the FTP prompt, enter the command: BINARY */ /* If you are using Kermit, use the Kermit command: */ /* SET FILE TYPE BINARY and make sure that KERMIT on */ /* your PC is set to BINARY as well. */ /* */ /* Hopefully, when you EXPORTed the dataset, you used PROC MEANS and */ /* CONTENTS to generate the same information generated by this file and */ /* can compare the results to make sure the data transferred correctly. */ /* ********************************************************************** */ /* If you need assistance with SAS please contact the statistical */ /* consultants at the ITC Research Computing Support Center at */ /* 244 Wilson Hall - 243-8000 M-F 9-5 or */ /* mail res-consult@virginia.edu */