RIT - COBOL Copybook

Content:

Introduced for RIT testers

Check out this Technote: COBOL Copybook introduced for RIT testers

Copybook Schema

RIT has the ability to apply a Copy Book to a message. This results that fields are mapped and you can easily work with the tags.

Figure: Cobol Copy Book before apply schema.

Figure: Cobol Copy Book after apply schema.

Example Copybook Schema

Sample Copy Book are:

Make sure you only copy the copybook information an do not embed unwanted HTML (infused by IE).

I experience that several improvements are made with the 6802 release.

Custom Functions

There are several custom functions available specific for COBOL environments. Check out: Custom Functions

ECMAscript - parseInt

Warning: parseInt("0012") is differnt than parseInt("0012",10)

COBOL makes use of leading zero's, the parseInt might switch to Octal or Hex in this routine. Force it to decimal: see tip on parseInt(x,10)...

String Length

In the COBOL copy book you will find often the combination of first a length of the string which is following. The length of the string can be calculated with ECMAscript, but that introduces for each variable a new length variable.

Figure: Setting with a script the length of %%NAME%% in %%LEN-NAME%%

By leveraging a function you can do it in one definition. Trimlength is available rit-functions.

Figure: Setting the length of leveraging the embedded trimlength function on %%NAME%%

If needed you can apply COBOL formatting like leading zero's. I found that after 6802 forcing leading zero's are not needed anymore.

Other Source

  1. Cobol Manual