Follow

How to make use of the batch "Transform" feature of the COBOL runtime

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:

SQLCONN-ATTRIBS:"attrib-values"     
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
e.g.: "P001,usr1,pwd1,jdbc:xx....,sqlDriver,,,,;P002,usr2,pwd,jdbc:xx....,sqlDriver,,,,"

INFILE-DSNPATH:"path/to/input/dataset"
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-DSNPATH:"path/to/output/dataset"
OUTFILE-ORIENT:INDEXED|NONINDEXED|LINEAR|NUMBERED|LINESEQUENTIAL                                         
OUTFILE-FORMAT:F|V|U|FB|VB|FBS|VBS|FBA|VBA                                                                                    
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

OUTFILE-PROTOCOL:EC|MF|MF3|MF8|CISAM|DISAM|EISAM|AS400|ACU|IBM|IBMV|IBMVB|SYNC|VSQL|VDB 
OUTFILE-CHARSET:IBM-1047|ISO-8859-1 
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.
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.  

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk