Designing your tableBASE table is a critical step in exposing API.
If the data is to be loaded exactly as it is from an existing data source, for example a physical sequential file or VSAM, tableBASE DK1TEXEC Utility can be used to define a tableBASE library, define a tableBASE table in the library, and load data into tables in the library. The provided sample JCL and control card can be used to get started with data that is available in a physical sequential file that is mapped by a DD name DATA. It will be loaded into a tableBASE library mapped by DD name MAINLIB as shown.
//DK1TEXEC EXEC PGM=DK1TEXEC
//STEPLIB DD DISP=SHR,DSN=your.tableBASE.load
//TBMSG DD SYSOUT=*
//TBRPT DD SYSOUT=*
//TBOPT DD *
TSRSIZE=2G
//DATA DD DISP=SHR,DSN=your.data.source
//MAINLIB DD DSN=your.tableBASE.library,
// SPACE=(TRK,(100,199),RLSE),
// DCB=(BLKSIZE=3120,LRECL=3120,RECFM=F,DSORG=PS),
// DISP=(,CATLG)
//CNTLCARD DD *
DEFINE NEWLIB=MAINLIB;
DEFINE TBL=EXMPCAT EST=1000 RSZ=80 KSZ=4 KLOC=1 LIB=MAINLIB
MTHD=B ORG=S;
LOAD TBL=EXMPCAT FROM=DATA LIB=MAINLIB;
/*
Detailed explanation of DK1TEXEC utility and its corresponding control cards can be found in the tableBASE Batch Utilities Guide in Chapter 2, DK1TEXEC Commands as well as Chapter 3, Using DK1TEXEC.
It is important to note how a tableBASE table is designed. APIs exposed via this interface directly correspond to how the data is organized in tableBASE table.
Key size and key location in the DEFINE TBL command play a critical role in how the API retrieves the data via a RESTful API HTTP query parameter.
If the HTTP GET request retrieves multiple records, an alternate index may be required on an alternate key. Details about how to create an alternate index can be found in the tableBASE Programming guide.