COBOL Batch Transform
The COBOL record editor allows the user to transform a file between various supported formats. (Refer to COBOL Record Editor ). As part of this process the user is allowed to save the transformation details to a .prof file. Using this file and the "Transform" program of the COBOL runtime the user can rerun the process from command line.
The command line is as follows:
java -cp <path to ecobol.jar>;<optional path to sql drivers> com.heirloomcomputing.ecs.util.Transform [help] [key:value] myprofile.prof
The location of ecobol.jar as well as the sql connection drivers can be set using CLASSPATH variable or using -cp option.
The [key:value] options allow the user to override or add to the settings in the .prof file. Note that values which contains spaces should be enclosed within quotes. For e.g.: OUTFILE-ALTKEY-OFFSETS:"[3, 2]"
Following are the settings that can be provided:
where attrib-values are positional sql connection attributes separated by ','. Specify multiple sets separated by ';' . The positional values are name,user,password,url,driver,autocommit,isolation,catalog,readonly
CONVERTCOUNT:n where n is the number of records to be converted
CONVERTRANGE:n-m where n-m is the range of records to be converted
OUTFILE-PRIMARY-OFFSETS:"[n, m, ....]" Primary key offsets
OUTFILE-PRIMARY-LENGTHS:"[n, m, ....]" Primary key lengths
OUTFILE-RELKEY-LENGTH:n Relative key length
OUTFILE-ALTKEY-OFFSETS:"[n, m, ....]" Alternate key offsets
OUTFILE-ALTKEY-LENGTHS:"[n, m, ....]" Alternate key lengths
OUTFILE-ALTKEY-DUPS:"[true, false, ....]" Alternate key duplicates allowed
OUTFILE-ALTKEY-GROUPS:"[n, m, ....]" Alternate key groups
OUTFILE-ALTKEY-GROUPS are used to identify split key groups. Non Split keys will have a indicator value of -1. For e.g.:- [0,0,-1,2,2,2,-1,3,3] represents the following keys:
two field split key(0,0) , non split key(-1), 3 field split key(2,2,2) ,a non split key(-1) and a two field split key(3,3)
OUTFILE-REC-MINIMUM:n Record minimum length
OUTFILE-REC-MAXIMUM:n Record maximum length
OUTFILE-REC-AVG:n Record average length
VDB-IDXINFO-idxname:"[n, m, ....][n1, m1, ....]"
For each alternate key in a VDB output, an attrib 'VDB-IDXINFO-idxname' is created, where idxname is replaced by the idx name that is specified in the Transform dialog. Note: OUTFILE-CHARSET corresponds with Java Charset, of which the IBM EBCDIC Charset has changed after Java 1.7 and "Cp1047" should be used instead of "IBM1047" or "IBM-1047".
The value consists of offset values[n, m, ....] followed by lengths[n1, m1, ....] of the alternate key
INFILE-RFS:"path/to/rfs" Record structure file
As can be seen all of the settings that are provided in the .prof file can be provided as part of the command line options. Thus one could effectually run the Transform program without providing a .prof file and instead providing all the needed information using the key:value pairs.