Thanks Bob.

…….Cameron





From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
Robert S. Hansel (RSH)
Sent: Thursday, January 20, 2022 8:06 AM
To: [email protected]
Subject: [External] Re: Having some challenges with a SORT Utility

Hi Cameron,

Generating and processing RACF LISTUSER data is extremely inefficient and is 
not a sanctioned application programming interface. I recommend you look into 
processing a RACF database unload file generated by the IRRDBU00 utility, with 
which you could probably use SORT's JOINKEY to do much of what you are trying 
to do with less code. Most installations generate an IRRDBU00 unload every day, 
so there is apt to be one readily available for you to use. Better still, I 
believe your firm has IBM's RACF add-on product zSecure. It might very well be 
able to generate the report you are looking for without having to write a 
single line of code. I suggest you contact your RACF Admin team to ask them 
about the availability of an IRRDBU00 unload and zSecure.

Regards, Bob

Robert S. Hansel 35 years of RACF Experience
Lead RACF Specialist 2021 #IBMChampion
RSH Consulting, Inc.
617-969-8211
www.linkedin.com/in/roberthansel<https://isolate.menlosecurity.com/1/3735928037/http:/www.linkedin.com/in/roberthansel>
www.twitter.com/RSH_RACF<https://isolate.menlosecurity.com/1/3735928037/http:/www.twitter.com/RSH_RACF>
www.rshconsulting.com<https://isolate.menlosecurity.com/1/3735928037/http:/www.rshconsulting.com>
---------------------------------------------------------------------------
Upcoming RSH RACF Training - WebEx
- RACF Level I Administration - APR 4-8, 2022
- RACF Level II Administration - MAR 7-11, 2022
- RACF Level III Admin, Audit, & Compliance - FEB 14-18, 2022
- RACF - Securing z/OS UNIX - JAN 24-28, 2022
---------------------------------------------------------------------------

-----Original Message-----
Date: Wed, 19 Jan 2022 22:23:51 +0000
From: Cameron Conacher 
<[email protected]<mailto:[email protected]>>
Subject: Having some challenges with a SORT Utility

Hello folks,
Hopefully someone can point me in a correct direction.
I can do this in a different manner, but I am stubborn.....

I have crafted a little sort utility to read a file and then to grab data from 
a couple of records and include the data with subsequent records.

So, I have a record identifying a dataset name. (One record)
Then some number of records later, I will have a record identifying an Owner 
group. (One record)
And then after a few records I will have some other record with names. (A 
number of records- hundreds or perhaps only one)

DataSet Name Record
Noise records
Owner Group record
Noise records
Name Record
Name Record
.
.
.
.
Noise records
DataSet Name Record

And so on.

My sort eliminate the noise records, and then I try to carry the dataset name 
and the owner group forward to add it to the name records for final output.

When I run my utility, I get the very first name record (with the dataset and 
owner information).
The subsequent name records do not have the additional data on output because 
somehow I have messed up.


Could someone have a peek at my sort control statement and suggest either a fix 
or tell me DON'T DO IT.

Thanks.

And here are my sort control statements.
**********************************************************************
* *
* SCAN THROUGH THE INPUT FILE AND GENERATE AN OUTPUT DETAIL *
* FILE COMBINING DATA FROM MULTIPLE RECORDS. *
* *
* WE ONLY WANT THE RECORDS CONTAINING ONE OF: *
* 'LISTDSD DATASET(' IN POSITION 002 *
* ' 00 ' IN POSITION 002 *
* ' ALTER ' IN POISITON 011 *
* 'CONTROL' IN POISITON 011 *
* ' READ ' IN POISITON 011 *
* 'UPDATE ' IN POISITON 011 *
* *
**********************************************************************

INCLUDE COND=(01,20,SS,EQ,C'LISTDSD DATASET', * ONLY LISTDSD RECS
OR,
01,20,SS,EQ,C' 00 ', * OWNER RECORDS
OR,
10,20,SS,EQ,C' ALTER ', * ALTER ACCESS
OR,
10,20,SS,EQ,C'CONTROL ', * CONTROL ACCESS
OR,
10,20,SS,EQ,C' READ ', * READ ACCESS
OR,
10,20,SS,EQ,C'UPDATE ') * UPDATE ACCESS


* *
* PARSE THE INPUT RECORDS LOOKING FOR THE LITERALS REPRESENTING *
* THE LISTDSD, OWNER AND RACF ID/ACCESS (DIFFERENT RECORDS) *
* USING A GROUP OF THREE RECORDS (1=LISTDSD 2=OWNER 3=RACF ID) *
* OVERLAY THE WORK AREA DATA IN 101-132 WITH: *
* 101-104 = 'RACF' *
* 105-150 = 45 CHARACTERS FOR LISTDSD NAME *
* 151-158 = OWNER NAME *
* 159-166 = RACF ID *
* 167 175 = RACF ID ACCESS ALLOWED *
* 181-184 = FOUR DIGIT RECORD NUMBER *
* 185-186 = TWO DIGIT GROUP ID NUMBER *
* 187-189 = THREE DIGIT SEQUENCE NUMBER *
* 190-190 = RECORD TYPE; 1=LISTDSD 2=OWNER 3=RACF ID/ACCESS *
* 191-193 = '123' RECORD TYPES *
* 201-245 = 45 CHARACTERS FOR LISTDSD NAME *
* 246-253 = EIGHT CHANRATER OWNER NAME *
* 254-261 = EIGHT CHANRATER RACF ID *
* 262-268 = SEVEN CHARACTER RACF ACCESS AVAILABLE *
* *
INREC IFTHEN=(WHEN=INIT,
BUILD=(001,080, * CURRENT RECORD
101:C'RACF', * LITERAL
105:C'LISTDSD', * LISTDSD DATASET
151:C'OWNER', * OWNER
159:C'RACF ID', * RACF ID
167:C'ACCESS', * RACF ID ACCESS
181:SEQNUM,4,ZD, * RECNUM
191:C'123')), * REC TYPE

*
* WE INITIALIZE THE LISTDSD IN 201-245
*
IFTHEN=(WHEN=INIT,
PARSE=(%01=(STARTAFT=C'LISTDSD DATASET(',
ENDBEFR=C')',
FIXLEN=45)),
OVERLAY=(201:%01)), * LISTDSD

*
* WE INITIALIZE THE OWNER IN 246-253
*
IFTHEN=(WHEN=INIT,
PARSE=(%02=(STARTAFT=C' 00 ',
ENDBEFR=C' ',
FIXLEN=8)),
OVERLAY=(246:%02)), * OWNER

*
* WE INITIALIZE THE RACF ID IN 254-270
*
IFTHEN=(WHEN=INIT,
PARSE=(%03=(STARTAFT=C' ',
ENDBEFR=C' ',
FIXLEN=17)),
OVERLAY=(254:%03)), * RACF DATA

*
* IF WE CAN FIND THE LISTDSD DATA ITEM
* SAVE THE LISTDSD IN 105-149
*
IFTHEN=(WHEN=GROUP,
BEGIN=(01,50,SS,EQ,C'LISTDSD DATASET('),
RECORDS=3, * COMBINING LISTDSD
PUSH=(105:201,45, * LISTDSD
185:ID=2,SEQ=3,
190:191,001)), * REC TYPE=1

*
* IF WE CAN FIND OWNER IDENTIFIER
* SAVE THE OWNER VALUE IN 151-158
*
IFTHEN=(WHEN=GROUP,
BEGIN=(01,50,SS,EQ,C' 00 '),
RECORDS=2, * COMBINING OWNER
PUSH=(150:246,08, * OWNER TAG
187:SEQ=3,
185:ID=2,SEQ=3,
190:192,001)), * REC TYPE=2

*
* IF WE CAN FIND RACF ID/ACCESS
* SAVE THE UPDATEABLE VALUE IN 120-122
* OF THE THREE RECORD TYPES WE SELECTED, ONLY THE RACF
* RECORD WILL HAVE A SPACE IN COLUMN 11.
*
IFTHEN=(WHEN=GROUP,
BEGIN=(10,01,CH,EQ,C' ',AND,02,02,CH,GE,C' '),
RECORDS=400, * COMBINING RACF
PUSH=(159:254,08, * RACF ID
167:264,07, * RACF ACCESS
185:ID=2,SEQ=3,
190:193,001)) * REC TYPE=3
*
*
SORT FIELDS=COPY LISTDSD

OUTFIL FNAMES=TRACEIT

*
* THERE ARE THREE RECORDS IN THE SORTED FILE FOR EVERY DDNAME
* THE DATA WE WANT IN THE SORTED FILE IS FROM RECORD TYPE='3'
* 101-104 = 'RACF'
* 105-149 = LISTDSD DATASET NAME
* 150-157 = OWNER TAG IDENTIFIER
* 159-166 = RACF ID
* 167-173 = RACF ID ACCESS
*
OUTFIL FNAMES=RACFOUT,
INCLUDE=(190,001,CH,EQ,C'3'),
OUTREC=(101,076)

END




Thanks

Cameron Conacher
Senior Engineer II

American Express Canada Inc.
GCICS
2225 Sheppard Avenue East, Toronto, ON M2J 5C2

[email protected]<mailto:[email protected]><mailto:[email protected]<mailto:[email protected]>>
Office: 1-437-836-5265
Mobile: 1-416-409-5147

https://amex.webex.com/join/cameron.conacher

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected]<mailto:[email protected]> with 
the message: INFO IBM-MAIN
________________________________
American Express made the following annotations
________________________________
This e-mail was sent to you by a representative of Amex Bank of Canada, P.O. 
Box 3204, Station "F", Toronto, ON, M1W 3W7, www.americanexpress.ca. If you no 
longer wish to receive these e-mails, please notify the sender by reply e-mail.

This e-mail is solely for the intended recipient and may contain confidential 
or privileged information. If you are not the intended recipient, any 
disclosure, copying, use, or distribution of the information included in this 
e-mail is prohibited. If you have received this e-mail in error, please notify 
the sender by reply e-mail and immediately and permanently delete this e-mail 
and any attachments. Thank you.

American Express a fait les remarques suivantes
Ce courriel vous a été envoyé par un représentant de la Banque Amex du Canada, 
C.P. 3204, succursale F, Toronto (Ontario) M1W 3W7, www.americanexpress.ca. Si, 
par la suite, vous ne souhaitez plus recevoir ces courriels, veuillez en aviser 
les expéditeurs par courriel.

Ce courriel est réservé au seul destinataire indiqué et peut renfermer des 
renseignements confidentiels et privilégiés. Si vous n’êtes pas le destinataire 
prévu, toute divulgation, duplication, utilisation ou distribution du courriel 
est interdite. Si vous avez reçu ce courriel par erreur, veuillez en aviser 
l’expéditeur par courriel et détruire immédiatement le courriel et toute pièce 
jointe. Merci.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to