Hi,Does any one know if it is possible to create a constant (fixed value) in CARLa using the DEFINE command, where I can explicitly specify the value of the constant, not getting it from any other field/variable?Basically, I am working with two "reports":The first one is a fixed list, containing two columns: system variable(symbol) and the value of the variable.Example:
TEST1 0001TEST2 0002TEST3 0003The second report is a verification of a system configuration:newlist type=system name=SYSTEM3 fieldsep=';'select smftwt<>"00:30"sortlist system smftwtHowever, in the second report's sortlist I need to include the information of a specific symbol from the fixed list.To do that, I would need to create a constant where I could explicitly define its value, for example: 'symtest' would contain the value TEST2In this case, I would be able to get the information from the other list like this:
deftype type=#symalloc type=#sym,path='xxxxxx/xxxxxx/xxxxxxx'def type=#sym #symbol as word(record,1)def type=#sym #empnum as word(record,2)newlist type=system name=SYSTEM3 fieldsep=';',select smftwt<>"00:30"sortlist system smftwt symtest symtest:#sym.#symbol.#empnumIt would basically search for the symtest value from the fixed list and include 'TEST2 0002' in the results. However, if I can't define a constant with a fixed value and give it the value I want, I won't be able to do it. I tried to do it in many ways using DEFINE, but I failed. Maybe it's very simple to do it, but I confess I wasn't able to.Thanks.
Use the STR$BLANK format to include a fixed value through a defined field. This is designed to print a STRING VALUE when a BOOLEAN is TRUE, and BLANK when it is FALSE. So:define symtest(str$blank('TEST2'),5) trueWith the overriding length 5 you could get 5 blanks to be printed when a variable condition is off, for example, only print TEST2 when you're analyzing system ABCD:define sysABCD(str$blank('TEST2'),5) boolean where system=ABCDFor other reports you should check the CHR$STR format, this can print a fixed STRING VALUE when a character field is empty, and otherwise print the field value.If you wish to define SYMTEST before the actual NEWLIST TYPE=SYSTEM command, you can add the newlist type in the DEFINE command, like sodefine type=system symtest(str$blank('TEST2'),5) trueNeither of these formatted output fields can be used as the base for a LOOKUP, since the field value is merely TRUE, and not really TEST2. If you want a REAL character field, containing TEST2, you should read this value from a DEFTYPE (external) file, and print it with a lookup from a field with a predictable value.------------------------------Rob van Hoboken------------------------------
Hi Jeroen,That is not exactly the idea I thought for this to work, but what you just explained worked perfectly. You got it! I really appreciate it.And yes, I do need to find a way of running this in batch: run the first query to substitute the information I need and build the second query, then run the second query to finally get the results I need. You said the setup would be different for a batch process, but is it possible to use the CKR2PASS in a similar way while running it in batch? Perhaps printing the built query in another file, then just executing it in the same code?I will try to do some research on it, but any hints would be very appreciated.Thank you so much for the help so far.