/*********************************************************************/ /* FILE is called export.sas */ /* By: Tim FJ Tolson, User Support, ITC, University of Va. */ /* ***** See documentation/explanations below ******* (6/92)*/ /*********************************************************************/ OPTIONS LINESIZE=80; TITLE 'Export SAS dataset to transport DATA set' ; LIBNAME saslib '.'; /* points to current directory */ LIBNAME transp XPORT 'transp.sasport'; /* transport dataset name */ 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 ; PROC COPY IN = saslib OUT=transp ; SELECT tests ; /* Use SELECT if have several SAS membernames in */ /* the SAS library and only want to move one */ /*-------------- INTRODUCTION ---------------------------------------*/ /* */ /* To run this file, simply type: sas export */ /* 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 export.LOG to see that the */ /* job ran correctly. Then print this file and save for future */ /* reference. The LOG file will list, for each Dataset, the */ /* number of observations and variables. You should ALSO print & */ /* check the export.LST file, which will have the results from */ /* the PROC CONTENTS and PROC MEANS. Use this file to compare to */ /* to the output from importing the file on the new computer sys- */ /* tem. */ /* */ /* There is a similar example file for IMPORTing the SAS transport */ /* dataset onto Watson. First link to the example minidisk by */ /* typing: EXAMPLE and then copy the file */ /* called IMPORTV5 SAS for version 5.18 of SAS or */ /* called IMPORTV6 SAS for version 6 of SAS to your minidisk */ /* */ /*----------***** EXPLANATION/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 */ /* written into. */ /* If there are more than one dataset in the default directory than all */ /* the datasets will be written into the ONE transport file. If you */ /* want to write separate datasets, 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 original dataset to the */ /* dataset AFTER you imported on your new 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 have created the SAS transport dataset you are ready to */ /* move it to a new computer system. They transfer MUST BE MADE in */ /* BINARY MODE! */ /* If you are going to WATSON, use the FTP command: BINARY F 80 */ /* because the SAS transport file on Watson must be LRECL 80, RECMF F */ /* If you are going to Poe or IBM PC compatible, use the FTP 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. */ /* */ /* When you IMPORT the dataset, use the PROC CONTENTS and PROC MEANS */ /* commands to generate the same information generated by this file and */ /* 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 */