Hi Danilo,
I don't think the thing what you are asking for is possible in that way. Normally when you annotate information, you base that on a value from the record that you want to annotate. (For example, usually when you want to print an employee number, you would base that on, say, a user id in the record.)
So, what you basically seem to want to do here is to specify a bunch of literal values sprinkled throughout the report through specifying one key, without a real association from the record to that key.
A way you can do that is come from the "annotation file" as the report type to pick up all those literal values, and from there generate the query of the report type you really want to have executed and annotated with those values, resulting in a two pass query, like so:
deftype type=#sym
alloc type=#sym,
path='xxxxxx/xxxxxx/xxxxxxx'
def type=#sym #symbol as word(record,1)
def type=#sym #empnum as word(record,2)
option dd=ckr2pass
newlist type=#sym outlim=1 nopage
select #symbol=TEST2
sortlist `newlist type=system name=SYSTEM3 fieldsep=';',` /,
`select smftwt<>"00:30"` /,
`sortlist system smftwt '` | #symbol(0) #empnum(0) | `'`
If you run this in the user interface like this, you should see the result of substituting the literals into the query, then you can press PF3 and run this query for the real result. This is because of the OPTION DD=CKR2PASS, which activates the two-pass query infrastructure. (If you want to run this in the batch, you need to use a different setup for this.)
The main query has NOPAGE because you are generating another query so you don't want page or column headers at that level. The OUTLIM=1 is just there to protect against TEST2 occurring on multiple lines [but that hopefully is not the case]; the duplicate entries would get ignored that way.
I use backquotes for what are literals from the perspective of the first query. The things that are backquoted essentially form the new query. That is basically everything except for the newlines and the literals that you are substituting. As to those literals, you can see that I generate single quotes around them so that they are literals to the generated query. I used overriding length 0 as I was guessing that the default output length of RECORD was not what you wanted to use there, but you might have a different column length in mind.
I hope this begins to help with what you are really trying to achieve.
Let me know if you have additional questions.
Best regards,
------------------------------
Jeroen Tiggelman
Software Development and Level 3 Support Manager IBM Security zSecure Suite
IBM
Delft
------------------------------
Original Message:
Sent: Thu November 18, 2021 01:09 PM
From: Danilo Farias
Subject: DEFINE a constant (fixed value) in CARLa
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 0001
TEST2 0002
TEST3 0003
The second report is a verification of a system configuration:
newlist type=system name=SYSTEM3 fieldsep=';'
select smftwt<>"00:30"
sortlist system smftwt
However, 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 TEST2
In this case, I would be able to get the information from the other list like this:
deftype type=#sym
alloc 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.#empnum
It 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.
------------------------------
Danilo Farias
------------------------------