To assign date to a variable ruleset in ODM

973 views Asked by At

I am currently working on ODM 8.0.1. I am working on a project where I am required to add a ruleset variable of date type.We need to integrate brms with mainframe.So we need to generate cobol code for it.So when we assign a ruleset variable of type Date and generate cobol code it throws error saying"need to initialize it".Then When we initialize it in the i itial value tab as java.util.Date(),then too its placing error while generating code.

Please help on how to set a ruleset variable to Date() type.

thanks in advance

2

There are 2 answers

0
Leon Matthews On

The initialization code should be "new java.util.Date()" if the type of the object being created is a java.util.Date. That should be fine and should work.

0
odmtim On

so with 8.0.1, you can use a converter that will convert your COBOL copybook to a date at the import. So, to do this, you need to update your COBOL XOM and select the COBOL member, right click it and add converter, select date and input your format. This will change the COBOL properties in the XOM telling the COBOL generation that it is a COBOL-date, and will generate the rules as appropriately. The format of the converter will limit the characters, so Java has a much longer date format, but if COBOL only takes 8 characters, the final business rule will take just 8 characters.

If you used the zRule Execution Server invocation of the rules engine versus COBOL generation, you'd be able to use Java methods to drive the rules and as long as there is this converter at the beginning stating this is a date that has 8 COBOL characters it will build it that way. With COBOL generation, you have to be wary of custom BOM to XOM methods as you risk having to do those VIA COBOL code versus the standard B2X methods.