Aster Format Files

Overview of Aster Format Files

The %INDAC_PUBLISH_FORMATS macro produces a format file for each user-defined format in the format catalog. These files are inserted into either the NC_INSTALLED_FILES table under the PUBLIC schema (Aster 4.5) or the NC_USER_INSTALLED_FILES table under a specified schema (Aster 4.6). The naming convention for the file is sasput_type_fmtname.xml, where type is the format data type (N for numeric formats or C for character formats), and fmtname is the format name.
For an example, see Example of a Format File.
There are three ways to see the format files that are created:
  • You can log on to the database using the Aster command line processor and submit an SQL statement. The following example assumes that three format files were created in Aster 4.6.
    >act -h hostname -u username -w password -d databasename -s schemaname
    >select name from schemaname.nc_user_installed_files where name like 'sasput_%';
    All the format files are listed:
    name
    -------------------------
    sasput_n_dinar.xml
    sasput_n_ruble.xml
    sasput_c_lowcase.xml    
  • From SAS, you can use SQL procedure code that produces output in the LST file.
    proc sql noerrorstop;
       connect to aster (user=username password=password dsn=dsnname schema=schemaname);
    select *
       from connection to aster
       (select filename, fileowner, uploadtime
       from schemaname.nc_user_installed_files where
       filename like 'sasput_%');
       disconnect from aster;
    quit;
    You can also use the SASTRACE and SASTRACELOC system options to generate tracing information. For more information about these system options, see the SAS System Options: Reference.
  • You can look at the SAS log. A message that indicates whether the format files are successfully or not successfully created is printed to the SAS log.

Example of a Format File

Here is an example of an Aster format file. This is a partial listing.
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="SUVformats.xsl"?>
<LIBRARY type="EXPORT" version="SUV">
   <HEADER>
      <Provider>SAS Institute Inc.</Provider>
      <Version>9.2</Version>
      <VersionLong>9.02.02M0P01152009</VersionLong>
      <CreationDateTime>2009-11-13T15:19:55</CreationDateTime>
   </HEADER>

   <TABLE name="N_DIVFMT">
      <TABLE-HEADER>
         <Provider>SAS Institute Inc.</Provider>
         <Version>9.2</Version>
         <VersionLong>9.02.02M0P01152009</VersionLong>
         <CreationDateTime>2009-11-13T15:19:55</CreationDateTime>
         <ModifiedDateTime>2009-11-13T15:19:55</ModifiedDateTime>

         <Protection />
         <DataSetType />
         <DataRepresentation />
         <Encoding>UTF-8</Encoding>
         <ReleaseCreated />
         <HostCreated />
         <FileName>c:\jaseco\tmp\SASWORK\920\_TD22220\#LN00024</FileName>

         <Observations length="187" />
         <Compression compressed="No" number="1" length="252" />
         <Variables number="21" />
      </TABLE-HEADER>

      <COLUMN name="FMTNAME" order="1" label="Format name">
         <TYPE>character</TYPE>
         <DATATYPE>string</DATATYPE>
         <LENGTH>32</LENGTH>
         <Offset>0</Offset>
      </COLUMN>

      <COLUMN name="START" order="2" label="Starting value for format">
         <TYPE>character</TYPE>
         <DATATYPE>string</DATATYPE>
         <LENGTH>16</LENGTH>
         <Offset>32</Offset>
      </COLUMN>

      <COLUMN name="END" order="3" label="Ending value for format">
         <TYPE>character</TYPE>
         <DATATYPE>string</DATATYPE>
         <LENGTH>16</LENGTH>
         <Offset>48</Offset>
      </COLUMN>

      <COLUMN name="LABEL" order="4" label="Format value label">
         <TYPE>character</TYPE>
         <DATATYPE>string</DATATYPE>
         <LENGTH>21</LENGTH>
         <Offset>64</Offset>
      </COLUMN>

      <COLUMN name="MIN" order="5" label="Minimum length">
         <TYPE>numeric</TYPE>
         <DATATYPE>float</DATATYPE>
         <Offset>85</Offset>
      </COLUMN>

      ... <more column definitions> ...

      <ROW>
         <DELTA-RECORD key="DIVFMT" />
         <FMTNAME>DIVFMT</FMTNAME>
         <START>1</START>
         <END>1</END>
         <LABEL>New England</LABEL>
         <MIN>1</MIN>
         <MAX>40</MAX>
         <DEFAULT>15</DEFAULT>
         <LENGTH>15</LENGTH>
         <FUZZ>1E-12</FUZZ>
         <PREFIX missing=" " />
         <MULT>0</MULT>
         <FILL missing=" " />
         <NOEDIT>0</NOEDIT>
         <TYPE>N</TYPE>
         <SEXCL>N</SEXCL>
         <EEXCL>N</EEXCL>
         <HLO missing=" " />
         <DECSEP missing=" " />
         <DIG3SEP missing=" " />
         <DATATYPE missing=" " />
         <LANGUAGE missing=" " />
      </ROW>

      <ROW>
         <FMTNAME>DIVFMT</FMTNAME>
         <START>2</START>
         <END>2</END>
         <LABEL>Middle Atlantic</LABEL>
         <MIN>1</MIN>
         <MAX>40</MAX>
         <DEFAULT>15</DEFAULT>
         <LENGTH>15</LENGTH>
         <FUZZ>1E-12</FUZZ>
         <PREFIX missing=" " />
         <MULT>0</MULT>
         <FILL missing=" " />
         <NOEDIT>0</NOEDIT>
         <TYPE>N</TYPE>
         <SEXCL>N</SEXCL>
         <EEXCL>N</EEXCL>
         <HLO missing=" " />
         <DECSEP missing=" " />
         <DIG3SEP missing=" " />
         <DATATYPE missing=" " />
         <LANGUAGE missing=" " />
      </ROW>

      ... <more row definitions>...

   </TABLE>
</LIBRARY>