Entering content frame

Background documentation Syntax Rules for Command Files Locate the document in its SAP Library structure

Note the following syntax rules for command files.

General Syntax Rules for Calling the Loader

Syntax Rules for Calling the Loader

Delimiting Lines Between Commands

Individual commands in a command file are separated by a line, at the beginning of which there is a double forward slash //.

When calling the LOADERCLI, you can use the option –cs to define an alternative command separator.

Comments

You can enter comments after a double forward slash // at the start of the line. The comments are ignored by the Loader when the command file is processed.

Example

CREATE TABLE customer
(cno       FIXED(4,0) NOT NULL,
 title     CHAR(7),
 firstname CHAR(10),
 name      CHAR(10) NOT NULL,
 zip       CHAR(5),
 address   CHAR(25) NOT NULL,
PRIMARY KEY (cno),
CONSTRAINT cno_dom CHECK cno BETWEEN 1 AND 9999,
CONSTRAINT title CHECK title IN ('Mr','Mrs','Company'),
CONSTRAINT zip_dom CHECK
   SUBSTR(ZIP,1,1) BETWEEN '1' AND '9' AND
   SUBSTR(ZIP,2,1) BETWEEN '0' AND '9' AND
   SUBSTR(ZIP,3,1) BETWEEN '0' AND '9' AND
   SUBSTR(ZIP,4,1) BETWEEN '0' AND '9' AND
   SUBSTR(ZIP,5,1) BETWEEN '0' AND '9',
FOREIGN KEY city_customer (zip) REFERENCES city (zip) ON DELETE RESTRICT
//
DATALOAD TABLE customer
  cno           1 CHAR
  title         2 CHAR DEFAULT NULL
  firstname     3 CHAR DEFAULT NULL
  name          4 CHAR
  zip           5 CHAR DEFAULT NULL
  address       6 CHAR
INSTREAM 'customer.data'
//create index
CREATE INDEX customer_index ON customer (name)
//
DATAEXTRACT cno, name, zip, address from customer
OUTFIELDS
  cno           1
  name          2
  zip           3
  address       4
OUTSTREAM 'newcustomer.data'

 

Leaving content frame