Working with User-Defined Formats

Problem

You want to use the View Data window to display data with user-defined formats, or you want to execute a job that contains a table with user-defined formats.

Solution

Make user-defined formats available from the SAS Application Server, or make them available for a particular job.
A format is an instruction that SAS uses to write data values. Formats are used to control the written appearance of data values, or, in some cases, to group data values together for analysis. An informat is an instruction that SAS uses to read nonstandard data values, such as dates, currency values, or hexadecimal values.
To make a custom format library available to any application that uses a particular SAS Application Server, administrators should see the "Working With User-Defined Formats" section of the "Connecting to Common Data Sources" chapter in the SAS Intelligence Platform: Data Administration Guide.
To make a custom format library available to a specific job, see Specify a Format Library in a Preprocess to a Job.

Tasks

Specify a Format Library in a Preprocess to a Job

SAS Data Integration Studio users can specify the location of the format library in a preprocess to a job. The preprocess would consist of SAS statements such as the following:
Options fmtsearch=(myformat library work); 
libname myformat "C:\formats\myformats";
The SAS Application Server that executes the job must be able to resolve the path that you specify in the LIBNAME statement for the format library.
The following steps describe one way to specify a format library in a preprocess to a job:
  1. From the SAS Data Integration Studio desktop, select the job that you want to update, and then select Editthen selectProperties from the menu bar. The property window for the job displays.
  2. Click the Precode and Postcode tab, and then select the Precode check box.
  3. In the code panel, enter a FMTSEARCH option and a LIBNAME statement that are similar to the previous example code.
  4. To save the precode in metadata, click OK. To save the precode to a file, click Save As, specify a server and filename for the code, and then click OK.
When you execute the job, the preprocess code runs first and the specified format library becomes available when the rest of the job executes.