Michael,
Using the example CARLa code from AM.4, you will need to add a line of code to put the access_lastuse field into something that can be used by $DATE to format the output into a YYYY-MM-DD format. The ACCESS_LASTUSE variable is in an internal TOD format which cannot be used by $DATE. We need to do two things: 1) convert TOD into one of the formats that $DATE can use and 2) display the converted date format as a YYYY-MM-DD format.
To accomplish the first goal, we can convert TOD into a Julian date format with this DEFINE statement
define jul_lastuse(juldate) as convert(access_lastuse,tod,date)
To accomplish the second goal, we can use $DATE as an output modifier for displaying the jul_lastuse variable
jul_lastuse(12,$DATE,"YYYY-MM-DD",key),
A partial screen capture of the output from the code I will include looks like this
Allowed Deny Unexp LastUse YYYY-MM-DD
5 0 0 4May2021 2021-05-04
Here is my code (shortened from what is generated by AM.4 as I didn't need everything.
n type=RACF_ACCESS name=CTBYCOND nodetailinherit required,
st="All access monitor records" I=CTBYCONN,
t="Connect authority use, by group"
/* generated by CKRP3AMX */
define count_suc(7,"Allowed",udec$abbr,bw,noprop)
sum(access_count_suc)
define count_vio(5,"Deny",udec$abbr,bw,noprop)
sum(access_count_vio)
define count_unk(5,"Unexp",udec$abbr,bw,noprop)
sum(access_count_unk)
define lastuse(9,"LastUse",noprop) max(access_lastuse)
define firstuse(7,"Firstuse",noprop) min(access_lastuse)
define prof#(5,"Prof",dec,bw,noprop) sumcount
define auth#(5,"Auth",dec,bw,noprop) count
define Miss#(7,"Missing",dec,noprop) count where
(proftype="missing"C)
define Pres#(8,"Permits",dec,noprop) count where
(proftype<>"missing"C)
define Perm#(8,"Permits and UACC",dec,noprop) count
define jul_lastuse(juldate) as convert(access_lastuse,tod,date)
select ,class=GROUP
display id(nd),
access_count_suc(7,key),
access_count_vio(5,"Deny",key),
access_count_unk(5,key),
access_lastuse(10,"LastUse",key),
jul_lastuse(12,$DATE,"YYYY-MM-DD",key),
id(pas,"Userid",key) access(7) id:name,
id:revoke(1) | id:revoke_inactive(1),
id:dfltgrp id:instdata
I used Julian date, because that was what was used in this excellent example from Rob van Hoboken in answering a similar question. You can read his excellent and detailed description of converting date formats at this link
https://community.ibm.com/community/user/security/communities/community-home/digestviewer/viewthread?GroupId=3463&MessageKey=69a57c47-4fce-4a91-bbe3-aed919c756e8&CommunityKey=44eb7c0d-9bc2-419b-9158-ad693e734065&tab=digestviewer
Alan
#ZSecurity#Support#SupportMigration