The defines on the second step was the source of my problem, I didn't have them set up correctly. This is exactly what was needed, thanks Sander!
Original Message:
Sent: Wed April 05, 2023 04:44 AM
From: Sander De Graaf
Subject: CARLa - Repeat group dates/DEFINEs with BOOLEAN
I managed to get to the following, where I believe #used and #inscope are correct. I use a two-step process, where the second process reads in the output of the first.
In the first process I generate a data set with the following CARLa
n type=racf dd=RPTPRE nopage retain
select segment=base class=user not(key=(irrcerta,irrmulti,irrsitec))
sortlist key(8) connects(8),
last_connect_date(10,$date) cgcreadt(10,$date)
This file is than read by a DEFTYPE newlist:
deftype type=$ljdate
define type=$ljdate userid(8) as substr(record,1,8)
define type=$ljdate group(8) as substr(record,10,8)
define type=$ljdate ljdate as,
convert(substr(record,19,10),datetime)
define type=$ljdate creadt as,
convert(substr(record,30,10),datetime)
define type=$ljdate #used true where,
ljdate>=today-100
define type=$ljdate #inscope true where,
creadt<=today-100
alloc type=$ljdate dd=RPTPRE
n type=$ljdate dd=report nopage
sortlist userid group ljdate(10) creadt(10) #used #inscope
Probably there is still something to enhance. I hope this helps.
Please note that using a define "BOOLEAN" is the same as define "TRUE" on SORTLIST.
------------------------------
Sander De Graaf
Original Message:
Sent: Tue April 04, 2023 01:42 PM
From: Steven Hoover
Subject: CARLa - Repeat group dates/DEFINEs with BOOLEAN
Hello,
Having some difficulty applying a Boolean define to repeat group values. Want to identify when GROUP CONNECTs are at least 100 days old and when they have been used in the last 100 days.
First attempt:
DEFINE #USED BOOLEAN WHERE LAST_CONNECT_DATE>=TODAY-100
DEFINE #INSCOPE BOOLEAN WHERE CGCREADT<=TODAY-100
NEWLIST TYPE=RACF NOPAGE retain
SELECT SEGMENT=BASE CLASS=USER
sortlist key(8) connects last_connect_date cgcreadt #used #inscope
The Boolean values seemed to be applied correctly, but only to the first value in the repeat GROUP (RETAIN caused the first value to be repeated for all repeat group entries).
Have also tried running the search without the Boolean indicators and then using the results as an input to another step, but have not been able to correctly use DEFINE/CONVERT to pull out date values into a format that is compatible with the Boolean DEFINEs.
Probably missing something silly, but have hit the wall. Any suggestions?
------------------------------
Steven Hoover
------------------------------