Hints and Tips for Batch Importing

  • The SAS/GIS batch import process provides less error checking than the GIS Spatial Data Importing window. 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, whether you use the GIS Spatial Data Importing window or the batch import process, 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 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, if you have the TIGER4 and TIGER5 filerefs allocated to the TIGER file types 4 and 5, and you want them to be imported, then 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. If you have modified a copy of the SASHELP.GISIMP data set and assigned the data set name to the USER_FIL macro variable, but you do not want to have that data set used for a specific import, then redefine the USER_FIL macro variable to point to the default data set, SASHELP.GISIMP, before performing an import of either type.
  • 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;