Original Message:
Sent: 12/11/2024 5:24:00 AM
From: Rob van Hoboken
Subject: RE: CARLa for Reporting on OMVS Segments
Hi Lynn
I'm entering my reply a second time, the first reply was held up because I wrote a syntax summary word(home,zzz,'/') except I used x instead of z. Guess what, 3 time x is a prohibited word in the forum.
Anyway, when I used word(home,3,'/') in the code, I had overlooked the way that word deals with the first / in the directory. I should have used word(home,4,'/') to catch the 3rd node of the directory! The code to generate your report should look like:
n type=racf nopage dd=ckr2pass
define once(nd) boolean where key=x /* any field test will do */
define each(nd) count
s c=user s=omvs exists(home)
summary once,
'newlist name=OMVSRQ1,',
/ ' tt="zSecure Suite USER OMVS Segment HDir UserID overview",',
/ ' st="Users HDir=/u/home/ does not match user ID"',
/ ' define subdir as word(home,4,"/") where home=:"/u/home/" and
missing(word(home,5,"/"))',
/ ' select c=user s=omvs'
summary each,
' exclude key=' | key(0) 'subdir=' | key(0)
summary once,
' sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),',
/ ' key(8,"User",key,pas) key:pgmrname,',
/ ' uid(10,num," Uid") home(20,"HomeDir") subdir(20,"SubDir")'
------------------------------
Rob van Hoboken
------------------------------
Original Message:
Sent: Tue December 10, 2024 07:31 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Hello Rob,
I think the problem was in the 'exclude'. I altered it to this syntax:
summary each,
' exclude ( key=' | key(0) ' and home=' | home(0) ')'
and with this formatted exclude statement generated by the 2-pass code:
select c=user s=omvs
exclude ( key=#CIA0A and home=/u/home/#cia0a )
It worked. the 'and' needed to be in parentheses.
I'll continue to work this to see if it's what these users want.
Many thanks for your 'bounce back' on my ramblings.
Lynn
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 06:56 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Rob,
Last minute update... I removed the parameter 'and subdir=#CIA0A' and the generated 'exclude' statements were in fact excluded. I guess either the 'subdir=' value is not right or does not contain data, or the 'and' statement does not work on the 'exclude' statement? I simply removed the 'and subdir=#CIA0A' from a group of statements and they were successfully excluded from the report. You probably already knew that (asking for 'SubDir' to print out (see code and output I pasted herein).
Having the 'and subdir=' in the exclude statement gives me more clarity though that these records are the ones we want to keep, only trying to find the odd ones out.
select c=user s=omvs
exclude key=#CIA0A
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 06:47 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Hello Rob!
Just wanted to summarize again (for my own clarity, sanity) using the 2-pass code you helped me with Rob works. The generated code properly generates all the 'exclude' statements where we found the RACF ID 'UserID' matches the '/u/home/userid' and is not case-sensitive. For example:
User Name Uid HomeDir SubDir
#CIA0A CICS SCHEDULER ID 1002235 /u/home/#cia0a
RACF ID User "#CIA0A" is correct in our scheme for the proper name for the HomeDir "/u/home/#cia0a" so the code generates an 'exclude' statement as:
exclude key=#CIA0A and subdir=#CIA0A
However, once the 2-Pass code generated is submitted and run it does NOT 'exclude' those in the report. I think that's what I'm aiming for with this report, trying to find all 'HomeDir' values that don't represent the RACF ID, and also to find any 'uppercase' values in the 'HomeDir'.
Many thanks Rob for reading thru my ramblings.
Lynn
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 05:58 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Hello Rob,
Received your suggestions. I modified the code to the following:
n type=racf nopage dd=ckr2pass
define once(nd) boolean where key=true
define each(nd) count
define subdir(char) as word(home,3,"/") where home=:"/u/home/" and
missing(word(home,4,"/"))
s c=user s=omvs exists(home)
summary once,
'newlist name=OMVSRQ1,',
/ ' tt="zSecure Suite USER OMVS Segment HDir UserID overview",',
/ ' st="Users HDir=/u/home/ does not match user ID"',
/ ' define subdir as word(home,3,"/") where home=:"/u/home/" and
missing(word(home,4,"/"))',
/ ' select c=user s=omvs'
summary each,
' exclude key=' | key(0) 'and subdir=' | key
summary once,
' sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),',
/ ' key(8,"User",key,pas) key:pgmrname,',
/ ' uid(10,num," Uid") home(20,"HomeDir") subdir(20,"SubDir")'
This generated CKR2PASS code as:
newlist name=OMVSRQ1,
tt="zSecure Suite USER OMVS Segment HDir UserID overview",
st="Users HDir=/u/home/ does not match user ID"
define subdir as word(home,3,"/") where home=:"/u/home/" and
missing(word(home,4,"/"))
select c=user s=omvs
exclude key=#CIA0A and subdir=#CIA0A
exclude key=#CIA0B and subdir=#CIA0B
exclude key=#CIA0C and subdir=#CIA0C
exclude key=#CIA0D and subdir=#CIA0D
exclude key=#CIA0E and subdir=#CIA0E
exclude key=#CIA0F and subdir=#CIA0F
exclude key=#CIA0G and subdir=#CIA0G
exclude key=#CIA0H and subdir=#CIA0H
exclude key=#CIA0I and subdir=#CIA0I
exclude key=#CIA0J and subdir=#CIA0J
exclude key=#CIA00 and subdir=#CIA00
sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),
key(8,"User",key,pas) key:pgmrname,
uid(10,num," Uid") home(20,"HomeDir") subdir(20,"SubDir")
I removed several hundred lines just to shorten it up and test it leaving only those 11 'exclude' statements. This produced a report as:
zSecure Suite USER OMVS Segment HDir UserID overview - complex TPX 10Dec2024 02:00
Users HDir=/u/home/ does not match user ID
User Name Uid HomeDir SubDir
#CIA0A CICS SCHEDULER ID 1002235 /u/home/#cia0a
#CIA0B CICS SCHEDULER ID 1002236 /u/home/#cia0b
#CIA0C CICS SCHEDULER ID /u/home/#cia0c
#CIA0D CICS SCHEDULER ID /u/home/#cia0d
#CIA0E CICS SCHEDULER ID 1003082 /u/home/#cia0e
#CIA0F CICS SCHEDULER ID 1003083 /u/home/#cia0f
#CIA0G CICS SCHEDULER ID 1003084 /u/home/#cia0g
#CIA0H CICS SCHEDULER ID 1003085 /u/home/#cia0h
#CIA0I CICS SCHEDULER ID 1003086 /u/home/#cia0i
#CIA0J CICS SCHEDULER ID 1003087 /u/home/#cia0j
#CIA00 CICS SCHEDULER ID 1001923 /u/home/#cia00
#CIA00QF CICS SCHEDULER ID 1003518 /u/home/#cia00qf
#CIA00QV CICS SCHEDULER ID 1003517 /u/home/#cia00qv
#CIA00TF CICS SCHEDULER ID 1003537 /u/home/#cia00tf
#CIA00W CICS SCHEDULER ID 1001924 /u/home/#cia00w
#CIA00WF CICS SCHEDULER ID 1003538 /u/home/#cia00wf
.
.
.
several hundred entries.
I hope this help with the 'exclude'. That 'SubDir' I included comes up blank.
Many thanks!
Lynn
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 05:29 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Yes, success after removing the NAME=OMVSGEN parameter. No error. Moving on to my 'exclude' processing in the 'gen'd code now. Many thanks for your help!
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 02:12 PM
From: Rob van Hoboken
Subject: CARLa for Reporting on OMVS Segments
OK, so there was a fix removed from CKRCARLA after I left IBM. I fixed the issue related to
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
but that fix is no longer there. To get the code I gave you going, you have to remove the parameter NAME=OMVSGEN from the first line, so:
n type=racf nopage dd=ckr2pass
Next:
define once(nd) boolean where true
CKR0128 12 Expecting relational operator or "(" instead of end of line at CKRCMDV line 2
CKR0987 12 Syntax error: text expected instead of end of line at CKRCMDV line 2
Can you try if this error still occurs after you removed the NAME parameter? If it is still there, to change line 2 into
define once(nd) boolean where complex==complex
------------------------------
Rob van Hoboken
Original Message:
Sent: Tue December 10, 2024 01:10 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Hello Rob,
Thanks very much for taking a look at this. I'm still working it but here are my results so far:
First run:
CKR0128 12 Expecting relational operator or "(" instead of end of line at CKRCMDV line 2
CKR0987 12 Syntax error: text expected instead of end of line at CKRCMDV line 2
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
CKR0000 12 CKRCARLA terminated due to input errors
Note: I altered "define once(nd) boolean where true" to "define once(nd) boolean where type=true" and it passed syntax check. I'm unsure if this is was intended by you.
Second run:
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
CKR0000 12 CKRCARLA terminated due to input errors
Note: these are produced at the lines 'each' and 'once' seen below:
Include CKRCMDV (ISPF variable)
1 |n type=racf name=OMVSGEN nopage dd=ckr2pass
2 | define once(nd) boolean where type=true
3 | define each(nd) count
5 | s c=user s=omvs exists(home)
7 | summary once,
8 | 'newlist name=OMVSRQ1,',
9 |/ ' tt="zSecure Suite USER OMVS Segment HDir UserID overview",',
10 |/ ' st="Users HDir=/u/home/ does not match user ID"',
11 |/ ' define subdir as word(home,3,"/") where home=:"/u/home/" and
12+| missing(word(home,4,"/"))',
13 |/ ' select c=user s=omvs'
15 | summary each,
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
16 | ' exclude key=' | key(0) ' and subdir=' | key
18 | summary once,
CKR0391 12 Duplicate NEWLIST NAME=OMVSGEN at CKRCMDV line 1, already defined at CKRCMDV line 1
19 | ' sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),',
20 |/ ' key(8,"User",key,pas) key:pgmrname,',
21 |/ ' uid(10,num," Uid") home(20,"HomeDir")'
End of CKRCMDV (include level 1)
I tried some variations and double/triple checked the code I pasted in but am now puzzled how to get this to work.
I'll keep analyzing. Maybe you have an idea?
Thanks very much,
Lynn Gilson
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
Original Message:
Sent: Tue December 10, 2024 11:42 AM
From: Rob van Hoboken
Subject: CARLa for Reporting on OMVS Segments
Hi Lynn.
Normally, you can use the == operator to compare the contents of one field with another. You can also use DEFINE to collect a substring or other token from a string. So if the uppercase/lowercase issue didn't apply, you would write your report like so:
newlist name=OMVSRQ1,
tt="zSecure Suite USER OMVS Setment HDir UserID overview",
st="Users HDir=/u/home/ does not match user ID"
define masklist as profile
define subdir as word(home,3,"/") where home=:"/u/home/" and missing(word(home,4,"/"))
s c=user s=omvs subdir<<>>masklist
sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),
key(8,"User",key,pas) key:pgmrname,
uid(10,num," Uid") home(20,"HomeDir")
However, the profile key (user ID) is in upper case and the 3rd word in the directory is lower case, and CARLa's == and <<>> operators compare field contents with field contents, without accepting different case values (I believe).
Luckily, when you compare a field value with a text (literal) value, the SELECT command first converts both values to upper case. So your report can be constructed as a two pass query, like so:
n type=racf name=OMVSGEN nopage dd=ckr2pass
define once(nd) boolean where true
define each(nd) count
s c=user s=omvs exists(home)
summary once,
'newlist name=OMVSRQ1,',
/ ' tt="zSecure Suite USER OMVS Setment HDir UserID overview",',
/ ' st="Users HDir=/u/home/ does not match user ID"',
/ ' define subdir as word(home,3,"/") where home=:"/u/home/" and missing(word(home,4,"/"))',
/ ' select c=user s=omvs'
summary each,
' exclude key=' | key(0) 'and subdir=' | key
summary once,
' sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),',
/ ' key(8,"User",key,pas) key:pgmrname,',
/ ' uid(10,num," Uid") home(20,"HomeDir")'
This code generates a CARLa program that selects the OMVS segment of all users, and excludes the ones where the user ID value is found in the 3rd node of the home field. Once this CARLa program is shown, you can issue the RUN command in the command line to produce the report.
Note: I have typed this from memory and not tried it. There are probably quotes of commas missing. Better some idea than no solution, right?
------------------------------
Rob van Hoboken
Original Message:
Sent: Mon December 09, 2024 07:08 PM
From: Lynn Gilson
Subject: CARLa for Reporting on OMVS Segments
Hello zSecure Community!
I have been asked to produce a report to discover all the OMVS HDir values (/u/home/userid) where the userid (lowercase or uppercase) is compared to the UserID and see the list of ones that DO NOT match. A second 'task' was to generate the same list but have 'uppercase' values in the HDir home directory value (/u/home/USERID). "Ours (mine) is not to reason why, ours (mine) is but to do and ..."
Using the zSecure panels, I was able to fashion a program as:
--------------------------------------------------------------------------
define masklist as profile
n required segment=OMVS n=selsegm outlim=0
s c=user segment=OMVS
n n=OMVSRQ1 segment=BASE required allowrestrict proflist=selsegm,
,
tt="zSecure Suite USER OMVS Setment HDir UserID overview",
st='Users HDir=/u/home/ '
s s=base c=user
sortlist " - complex"(tt,page) complex(tt,page) stamp(tt),
,
key(8,"User",key,pas) key:pgmrname,
key:uid(10,num," Uid") key:home(20,"HomeDir")
--------------------------------------------------------------------------
... and this produced a report as:
--------------------------------------------------------------------------
zSecure Suite USER OMVS Setment HDir UserID overview - complex TPX 9Dec2024 02:00 page 1
Users HDir=/u/home/
User Name Uid HomeDir
#CIA0A CICS SCHEDULER ID 1002235 /u/home/#cia0a
#CIA0B CICS SCHEDULER ID 1002236 /u/home/#cia0b
#CIA0C CICS SCHEDULER ID /u/home/#cia0c
#CIA0D CICS SCHEDULER ID /u/home/#cia0d
.
.
.
How could I modify the CARLa to look for and compare lowercase values to uppercase values? How could I parse to the Userid value in the HDir value returned by CARLa (/u/home/userid). I'm curious if there is a way - I've looked thru the 'CARLa Command Reference' for 'offset' use but it doesn't apply here I think.
Many, many thanks for hosting this forum. Really appreciate you guys.
Lynn Gilson
------------------------------
Lynn Gilson
SysProg
Ensono Corp.
Downers Grove, IL,USA
+001-630-944-1442
------------------------------