MyBook.cpy - Various Cobol Types, handy for testing
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.
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)...
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.