© Copyright IBM Corp. 2003. All rights reserved. 331
Appendix C. RACF userid conversion
script
The following REXX exec was used in 7.5.6, “Mass-exporting RACF users to
LDAP” on page 313 to convert exported RACF userids to LDAP entries.
Example: C-1 CONVLDIF REXX program listing
/**************************** REXX ***********************************/
/* CONVLDIF: Merge an exported RACF user list file and a LDIF */
/* template file to an ldif file for Portal Server */
/* */
/*********************************************************************/
/* Usage: */
/* */
/* 1. Use an LDIF Browser to export RACF userds to a file. The file */
/* will contains dn: racfid=USERXXX,profiletype=USER, o=YYYYYY. */
/* 2. Create a templete file with correct ldif format. */
/* 3. Replace the name specified in uid of dn:, givenname, */
/* ibm-natived, sn, name portion of the mail, uid and cn fileds */
/* with #racfid1, #racfid2 or #racfid3. */
/* #racfid1: Uppercase, #racfid2: lowercase, and #racfid3: first */
/* letter uppercase. */
/* 4. Create an empty output file. */
/* 5. Match all the three file names with this REXX script. */
/* . Replace <YourHLQ> to your selected datasets pefix (ie. JAVA1) */
/* 6. Run this REXX script and the outpit file will have the merged */
C
332 WebSphere Portal on z/OS
/* ldif format. */
/* */
/*********************************************************************/
/* Date who COMMENT */
/* ------- ----- -------------------------------------------------- */
/* 5/29/03 CCC Created */
/* */
/*********************************************************************/
/* step1: Get input file names */
"free fi(INDD1)"
"free fi(INDD2)"
"free fi(OUTDD1)"
infile1 = "<YourHLQ>.TEMPLATE.INPUT"
infile2 = "<YourHLQ>.RACFID.INPUT"
outfile1 = "<YourHLQ>.MERGED.OUTPUT"
"alloc fi(INDD1) da('"infile1"') shr reuse"
"alloc fi(INDD2) da('"infile2"') shr reuse"
"alloc fi(OUTDD1) da('"outfile1"') shr reuse"
EOFFLAG1 = 2 /* return code to indicate end-of-file */
RETURN_CODE1 = 0 /* initialize return code */
"EXECIO 0 DISKR INDD1 (OPEN" /* open template file */
"EXECIO 0 DISKR INDD2 (OPEN" /* open table */
"EXECIO 0 DISKW OUTDD1 (OPEN" /* open outout file */
/*----------------------------------------------------------------*/
/* step2: read in the template file */
/*----------------------------------------------------------------*/
bPattern = 'racfid=' /* Begin pattern */
ePattern = ',' /* End pattern */
token = '#racfid' /* Token to be replaced */
nTotal = 0 /* Total template lines */
lSeg. = '' /* Left Segment of the template line */
rSeg. = '' /* Right segment of the template line */
lineMerge. = 0 /* Default to no merger for this line */
Name_case. = 1 /* set default to upper case */
junk = ''; s1 =''; s2= ''; s3= ''
Case = 0 /* Case = 1, 2, or 3 */
strUpper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /* Translate table in */
strLower = 'abcdefghijklmnopqrstuvwxyz' /* Translate table out */
Appendix C. RACF userid conversion script 333
N = 0 /* template line counter */
P = 0 /* #racfid location */
ALINE = '' /* init */
say ''
say " *** Start to read template list file ... "
say ''
/*----------------------------------------------------------------*/
nTotal = 0 /* Total template lines */
lSeg. = '' /* Left Segment of the template line */
rSeg. = '' /* Right segment of the template line */
lineMerge. = 0 /* Default to no merger for this line */
Name_case. = 1 /* set default to upper case */
junk = ''; s1 =''; s2= ''; s3= ''
Case = 0 /* Case = 1, 2, or 3 */
token1= 'racfid=' /* locate racfid= */
token = '#racfid' /* Replace with racfid */
strUpper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' /* Translate table in */
strLower = 'abcdefghijklmnopqrstuvwxyz' /* Translate table out */
N = 0 /* template line counter */
P = 0 /* #racfid location */
ALINE = '' /* init */
say ''
say " Start to read template list file ... "
say ''
DO WHILE (RETURN_CODE1 \= EOFFLAG1) /* loop while not end-of-file */
'EXECIO 1 DISKR INDD1' /* read 1 line from template */
RETURN_CODE1 = RC /* save execio rc */
IF RETURN_CODE1 = 0 THEN /* get a line ok? */
DO /* yes */
N = N + 1 /* Line counter */
PARSE PULL ALINE
P = POS(TOKEN,ALINE,1) /* Get TOKEN location */
IF (P \= 0) THEN /* IF a token is found */
DO
lineMerge.N = 1 /* Will merge this line */
PARSE VAR ALINE lSeg.N =(P) JUNK +7 Case +1 rSeg.N
SELECT /* -----Start Select ----- */
WHEN Case = '1' THEN

Get WebSphere Portal on z/OS now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.