Hints and Tips for Batch Importing

  • The SAS/GIS batch import process provides less error checking than the GIS Spatial Data Importing window. Ensure that the values that you define for the input parameters are valid. Defining invalid values for the input parameters will cause the import to fail.
  • The GIS Spatial Data Importing window interface lets you modify the default composites and the default layer definitions before you proceed with the import. The batch import process does not provide this functionality. To modify the composites and layers before the import occurs, you must use the GIS Spatial Data Importing window. However, it does not matter which method you use to complete the import. You can always use PROC GIS after the import is complete to make changes to your map and its underlying components.
  • The batch import for the 1990 – 2006 TIGER and DYNAMAP import types does not automatically import all of the files, only the required file types 1 and 2. To use the batch import process to import any or all of the optional file types, you need to perform the following steps:
    1. Copy the SASHELP.GISIMP data set to a location where you have Write access. For example, copy the SASHELP.GISIMP data set into the SASUSER library:
      proc copy in=sashelp out=sasuser;
         select gisimp / mt=data;
      run; 
    2. Edit the SASUSER.GISIMP data set and change the value of the REQ variable for the TIGER or DYNAMAP file type from 0 (zero) to 1. For example, you have the TIGER4 and TIGER5 filerefs allocated to the TIGER file types 4 and 5, and you want them to be imported. In that case, you could run the following DATA step to change the value of the REQ variable:
      data sasuser.gisimp;
         set sasuser.gisimp;
         /* Make sure that the values of the
            FILEREF variable are in all uppercase. */
         if fileref in ('TIGER4' 'TIGER5')
            then req=1;
      run;
      However, you could also use FSBROWSE, FSVIEW, VIEWTABLE, or any other method that you are familiar with to change the value of the REQ variable. Just remember that for the import type that you choose, it will import only from the filerefs for which REQ=1 in the data set.
    3. For SAS/GIS to use the new SASUSER.GISIMP data set, you must define the USER_FIL macro variable to point to the name of the new data set. For example:
      %let USER_FIL=SASUSER.GISIMP;
      As long as the USER_FIL macro variable is defined when the SASHELP.GISIMP.BATCH.SCL entry is executed, it will use the current values of REQ to specify which files are imported.
  • The SASHELP.GISIMP data set also contains the default librefs for the output catalog entries and spatial data sets. You can modify these defaults by making a copy of the SASHELP.GISIMP data set and changing the values for the DEFMLIB and DEFSLIB variables to a valid, assigned libref. You then need to define the macro variable USER_FIL to point to your modified copy of the data set.
  • The data set that is specified by the USER_FIL macro variable is used by both the batch and interactive imports. Consider the case where you have modified a copy of the SASHELP.GISIMP data set and assigned the data set name to the USER_FIL macro variable. However, you do not want to have that data set used for a specific import. You need to redefine the USER_FIL macro variable to point to the default data set, SASHELP.GISIMP, before performing either an interactive or a batch import.
  • Throughout this chapter, all of the macro variable names, their values, and all filerefs have been shown in all uppercase for clarity. However, their names and values are not case-sensitive. For example, the following four statements are equivalent:
    %let imp_type=sasgraph;
    %let imp_type=SASGRAPH;
    %let IMP_TYPE=sasgraph;
    %let IMP_TYPE=SASGRAPH;