1.1.10.6 Parameter(s)
prepro-ims.pl
parameters, exit codes, and support modes are listed in the following tables respectively.
Table 1-4 prepro-ims.pl Parameters
Option name | Value range | Comment |
---|---|---|
-i
|
existing file(s) or directory | It's the original C program file[s] from IBM IMS application project. The suffix of file name must be .c or .h. As well, simple wildcards like '*' and '?' are supported. |
-o
|
file or directory | It's the destination file or directory to be written. If the directory doesn't exist it will be created. |
-m
|
file | It's the makefile generated for destination programs. It is placed in the destination directory. This file name should not be relative or absolute path. |
Table 1-5 Exit Codes
Exit code | Meaning | Comment |
---|---|---|
0
|
Success | |
1
|
Failure | general failure |
2
|
Failure | invalid argument |
Table 1-6 Support Modes
-i | -o | Support |
---|---|---|
directory | directory | Y |
dir1/file1 | dir2/file2 | Y |
dir1/file1 | dir2 | Y |
dir2/file2 … | dir3 | Y Directories of source files must diff with dir3. |
The source program must look like that shown in the following Listing.
Listing Source Program
/* #pragma runopts(env(IMS), plist(IMS)) */
#include <ims.h>
#include <stdio.h>
#define n 20 /* I/O area size - Application dependent */
typedef struct {PCB_STRUCT(10)} PCB_10_TYPE;
int main()
{
static const char func_GU[4] = "GU ";
static const char func_ISRT[4] = "ISRT";
char ssa_name[] = "ORDER ORDER (ORDERKEY = 666666)";
int rc;
char msg_seg_io_area[n];
char db_seg_io_area[n];
char alt_msg_seg_out[n];
PCB_STRUCT_8_TYPE *alt_pcb;
PCB_10_TYPE *db_pcb;
IO_PCB_TYPE *io_pcb;
io_pcb = (IO_PCB_TYPE *)__pcblist[0];
alt_pcb = __pcblist[1];
db_pcb = (PCB_10_TYPE *)__pcblist[2];
..
/* get first message segment from message area */
rc = ctdli(func_GU, io_pcb, msg_seg_io_area, NULL);
..
/* get the data from the database having the specified key value */
rc = ctdli(func_GU, db_pcb, db_seg_io_area, ssa_name, NULL);
..
/* build output message in program's I/O area */
rc = ctdli(func_ISRT, alt_pcb, alt_msg_seg_out, NULL);
..
}
Parent topic: prepro-ims.pl