Hi Steve
The field CGGRPNM that you've used represents the list of connect groups, so it can (and probably) will contain more than one entry. This is referred to as a repeat field. The SELECT command (SELECT CGGRPNM=(@ADJPAY,@DDE)) selects the entire user profile if the user is connected to either @ADJPAY or to @DDE, including the list of all connect groups.
If you wanted to prune down the list of connect groups for a selected user, you would have to use the DEFINE SUBSELECT command, like so:
newlist type=racf
define onlyDDEgroups subselect connects(group=@dde@*)
define onlyADJgroups subselect connects(group=@adj*)
SELECT S=BASE C=USER CGGRPNM=(@ADJPAY,@DDE)
sortlist profile(8,"Userid") onlyDDEgroups(8) onlyADJgroups(8)
Unfortunately, you cannot apply PARSE or SUBSTR to the result of SUBSELECT, so you're stuck with the whole 8 character group name, or left aligned truncation.
Now, if you print the CGGRPNM field, or a defined field based on CGGRPNM (like your ADJPAY and DDE fields), the result is a stack of values. CARLa offers a modifier to show only the first value of the repeat field: FIRSTONLY.
Also, CARLA has a SORT modifier that can be used on repeat fields, it works on the internal value of the field. I do not remember if a defined field with PARSE stores the parse output as an internal value, or if it re-calculates this for the SELECT command and again for the SORTLIST command, but you can try.
newlist type=racf
DEFINE ADJPAY AS PARSE(CGGRPNM,'@ADJ',' ') WHERE CLASS=USER
DEFINE DDE AS PARSE(CGGRPNM,'@DDE@',' ') WHERE CLASS=USER
SELECT S=BASE C=USER CGGRPNM=(@ADJPAY,@DDE)
sortlist profile(8,"Userid") adjpay(sort(descending),firstonly) dde(sort(descending),firstonly)
Sorry, you'll have to test this yourself, I no longer have access to a z/OS.
------------------------------
Rob van Hoboken
------------------------------
Original Message:
Sent: Thu January 04, 2024 03:06 PM
From: Steve Weaver
Subject: CARLA output going to multiple lines
My novice code:
DEFINE ACEID("ACEID",CHAR) AS SUBSTR(INSTDATA,172,6) WHERE CLASS=USER
DEFINE ADJPAY AS PARSE(CGGRPNM,'@ADJ',' ') WHERE CLASS=USER
DEFINE DDE AS PARSE(CGGRPNM,'@DDE@',' ') WHERE CLASS=USER
NEWLIST N=BASEU1 SEGMENT=BASE REQUIRED ALLOWRESTRICT NOPAGE
SELECT S=BASE C=USER CGGRPNM=(@ADJPAY,@DDE)
SORTLIST KEY(8,TRUNC), ACEID(7,TRUNC), ADJPAY(2,TRUNC), DDE(2,TRUNC), CGGRPNM(SORT,HOR,WORDWRAP,60)
Trying to get output that looks like:
BCD6F0 BCD6F0 PA H1 #HQEMRS @ADJPAY @DDE@H1 USPS#690
Getting output that looks like:
BCD6F0 BCD6F0 #HQEMRS @ADJPAY @DDE@H1 USPS#690
PA
H1
It looks like I get a separate line for everygroup including ones that don't match my criteria.
------------------------------
Steve Weaver
z/OS Systems Programmer
US Postal Service
San Mateo CA
510-377-1138
------------------------------