Computer Corporation of America
|
Feedback
Search CCA:
   
USA CCA
CCA Products
CCA Customer Support
CCA Resources
CCA - Company
CCAPRINT: A Newsletter for Model 204® and System 1032® Users
November 10, 1997

Incremental file loads in Model 204

by Donna Goodwin

Did you ever want to do partial loads of a file using the generic PAI FLOD code but couldn't figure out how to do it?
 
The first three FILELOAD (FLOD) parameters let you do partial loads. They specify how many:
 
k = Model 204 records to load during the run
n = Times to execute the FLOD code
m = Input records to skip
 
For example, the PAI input records look like the following, where a line with an asterisk separates one Model 204 record from another:
*
NAME = SMITH, BILL
ADDRESS = UNKNOWN
*
NAME = JONES, ELIZABETH
ADDRESS = SUITE 43, ROOM 435
ADDRESS = 231 MAIN STREET
CITY = ANYTOWN
STATE = NY
*
NAME = GEORGE, SAMUEL
NAME = PARKER, SAMANTHA
CITY = SMALL TOWN USA
STATE = SD
*
Because Model 204 records typically consist of a variable number of fields (input records), how many input records do you skip before loading the next group of Model 204 records? For example, use the previously listed input to load only the second record. Enter:

FLOD 1,-1,3

where:

 Setting  Means...

 1

 Load 1 database record

 -1

 Execute the code enough times to complete the processing

 3

 Skip two input records and one asterisk line

Pretty simple: you just count the lines to skip. But what if you want to load groups of 5000 records. How many lines do you skip each time? If you guess wrong and come in "between the asterisks," you end with the following message:

M204.0704: NO RECORD DEFINED - FLOD

Let Model 204 do the counting
 
The key to determining how many input records to skip is in the output of the load you ran previously. You check to see how many input records had to be read to load the previous group. Then subtract 2 from that number to get the number to skip in the next run. The subtraction accounts for the asterisk line and the first field=value record of what will become the next Model 204 record, which must be read before the record count (k) is satisfied.
 
Loading groups of records

To load the first 5000 records, enter:

FLOD 5000,-1,0

Model 204 interprets this command to:

1. Load 5000 Model 204 records
2. Execute the code as many times as necessary (-1)
3. Skip 0 records

At the end of this run, Model 204 displays the following statistics:

***M204.0703: FLOD FINISHED -- RECORD COUNT SATISFIED
RECORDS READ ADDS DELETES AF DF
30003 5000 0 24999 0

Take the number of input records and separating asterisks read, RECORDS READ (30003 in this case), and subtract 2 for the "number to skip" in the next run.

To load the second 5000, enter:
 
FLOD 5000,-1,30001
 
At the end of the run, Model 204 displays:
***M204.0703: FLOD FINISHED -- RECORD COUNT SATISFIED
RECORDS READ ADDS DELETES AF DF
59988 5000 0 24985 0
 
Load the third group of records using the statistics from the previous run (59988 - 2). Enter:
FLOD 5000,-1,59986
After which Model 204 displays:
 
***M204.0703: FLOD FINISHED -- RECORD COUNT SATISFIED
RECORDS READ ADDS DELETES AF DF
89978 5000 0 24990 0
 
To load the fourth group of records, enter:
 
FLOD 5000,-1,89976
 
CCA recommends this technique of loading records in groups when the number of records and fields to load is so large that the resulting sort of deferred-index records exceeds the resources available to most sort utilities. Splitting the load into 3 or more equal parts might be the most expedient way to accomplish the deferred-index sort.
 
Note: The discussion in this article makes use of the PAI FLOD code documented in the V4R1 Model 204 File Manager's Guide. If you are using an earlier version of PAI FLOD code, subtract only 1 to determine the number of records to skip.

Michael Crosswhite, a Model 204 consultant currently on assignment in Texas, contributed greatly to this article.

End-of-year Model 204 courses

To ensure that you get the best value from Model 204 and your training time, plan to attend one or more of the following courses that CCA Education Services is offering before the year ends.

 Course title

 Dates

 Site

 Implementing Online Applications  December 1-4  McLean, VA
 Application Subsystem Facility  December 4  McLean, VA
 Introduction to User Language  December 3-5  Framingham, MA
  Model 204 V4R1 Update class  December 5  McLean, VA
 Introduction to System Management  December 8-10  McLean, VA
 Batch Processing  December 11-12  McLean, VA

To register for any of these classes or for more information, visit our Web site at www.cca-int.com (Customer Support area) or call us at 703-506-1600 (McLean, VA) or 508-270-6666 (Framingham, MA).

ODBC and System 1032 data type comparison

by Tym Stegner

The ODBC Application Programming Interface V2 for System 1032 is coming soon! It's time to start making sure that your datasets are prepared.

Following are the ODBC data types and the System 1032 data types to which they map.

ODBC data type System 1032 data type(s) Comments
SQL_BIT Logical  
SQL_CHAR Text n (n < 256)
User of Entry, Change, Delete
Length: n
Length: 12
SQL_DATE Date
Date of Entry, Change, Delete
Precision: days
Precision: days
SQL_DECIMAL Decimal  
SQL_DOUBLE Integer Double
Real Double
 
SQL_INTEGER $ID
Integer
Integer of ID
Primary key

Readonly
SQL_LONGVARBINARY Binary Varying Being tested
SQL_LONGVARCHAR Text n (n > 256)
Text Varying
[To n (n > 256)]
 
SQL_REAL Real  
SQL_SMALLINT Integer -32768:32767  
SQL_TIME Time_Span Precision: sec; Range: 0 to 23:59:59
SQL_TIMESTAMP Date_Time of Entry, Change, Delete Precision: sec
SQL_TINYINT Integer 0:25  
SQL_VARCHAR Text Varying To n (n < 256) Length: n

 

For System 1032 users, certain questions immediately spring to mind: "What about groups? What about arrays?" The short answer is: "These are not valid ODBC data types."

Happily, the ODBC V2 interface is going to handle these oft-used System 1032 data types:

  • Array-Multiple scalar fields with array name suffixed by the element number: SURNAME (2) becomes SURNAME_1, SURNAME_2.
  • Group-Group elements with qualified names: STARS Group of FN,LN becomes STARS_FN, STARS_LN.
  • Group of Array-Combination of the above.
  • Array of Group-Not supported.
  •  

     
    Copyright © 2003 Computer Corporation of America.
    All right reserved. Published in the United States of America.

    500 Old Connecticut Path, Framingham, MA 01701
    webmaster@cca-int.com
    Copyright 2005