Previous Topic: Create Table Syntax Generated by CA CulpritNext Topic: Assigning Null Values to an SQL Column


Converting ASF Tables to SQL Tables

The job of converting a ASF table to an SQL table is really quite simple using CA Culprit. Simply read the ASF table as input, and create an OUTPUT SQL table with TYPE=CREATE.

CA Culprit Syntax

 col. 2
 ▼
 PRO    USER=MZC  PW=
 INPUT  TABLE=INVENTRY  TYPE=COPY   CATALOG=ASFDICT
 01OUT  SQLTABLE=INVENTORY  TYPE=CREATE
*       DICTIONARY=TSTDICT  SCHEMA=INV
*       BULKROWS=500
 010    UNITS_ON_HAND   0
 010    ZERO            0
 0151*010  WAREHOUSE      SZ=10  NOT NULL
 0151*020  PRODUCT_CODE   SZ=10  NOT NULL
 0151*030  UNITS_ON_HAND  FP     SZ=4
 0151*031  ZERO           FB     SZ=4
 017       MOVE ITEMS_IN_STOCK TO UNITS_ON_HAND
 017       TAKE

The technique of moving ITEMS_IN_STOCK to UNITS_ON_HAND lets the user create new SQL column names for the fields. Data values can be converted from one format within ASF to another SQL data type by simply coding a format code and SZ= on the edit card.

Parameter 0151*031 is the null indicator value for the UNITS_ON_HAND field. It must be present, and must have a data specification of FB SZ=4. Often a work field initialized to zero is used to represent a null indicator that may not have been present on the input data file.