If you have the proper authority, you can DSPUSRPRF *ALL Output(*OUTFILE)
Then do a Query or SQL of the file that was produced.
Query based on user profile status, like UPSTAT = '*DISABLED'
Last Wiki Answer Submitted: May 17, 2011 1:03 pm by CharlieBrowne33,695 pts.
All Answer Wiki Contributors: CharlieBrowne33,695 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
One specific thing to beware of is that this editor kind of trashes single- and double-quote marks under various circumstances. If you put this into a source member, look it over carefully to catch where single-quotes need to be manually typed over.
If the printed report is longer than a single page, you might consider adding a “page-heading” subroutine.
You can compile the module and create the program in any library you wish. Just be sure to use the example CRTCLMOD and CRTPGM parameters at the least. You can add additional parms, but you’ll have to debug oddities that will arise if you want to remove any from the minimum suggested parms.
Thanks a lot, I’ll try tomorow
I’m not sure what kinds of tips you need. This is a pretty straightforward process. Here’s a trivial sample CL program that prints such a list:
/* + CRTCLMOD MODULE( mylib/LSTUSRDSE ) + SRCFILE( mylib/QCLSRC ) + SRCMBR( LSTUSRDSE ) + LOG( *NO ) + + CRTPGM PGM( mylib/LSTUSRDSE ) + BNDDIR( QC2LE ) + ACTGRP( *NEW ) + USRPRF( *OWNER ) + */ pgm ( + ) dcl &msgdta *char 128 dcl &NL *char 1 value( x'15' ) dcl &x00 *char 1 value( x'00' ) dcl &rc *int dcl &eofUSRDSE *lgl value( '0' ) /* Compile over the IBM-supplied model file... */ dclf QADSPUPB /* List user profiles to a temporary file... */ dspusrprf *ALL output( *OUTFILE ) outfile( QTEMP/LSTUSRDSE ) /* ...and point the compiled file to our temporary one... */ ovrdbf QADSPUPB tofile( QTEMP/LSTUSRDSE ) /* Set a trivial page heading... */ chgvar &msgdta ( + 'List Disabled Profiles' *cat + &NL *cat + &NL *cat + &x00 + ) /* Assign our printed output to QPRINT... */ ovrdbf STDOUT + tofile( QPRINT ) + ovrscope( *JOB ) + share( *YES ) /* Print our trivial heading... */ callprc 'printf' ( + &msgdta + ) + rtnval( &rc ) /* Now loop through our temporary file until EOF... */ dountil ( &eofUSRDSE ) rcvf monmsg ( cpf0864 ) exec( do ) chgvar &eofUSRDSE '1' iterate enddo /* If this one is '*DISABLED', print a line... */ if ( &UPSTAT *eq '*DISABLED' ) do chgvar &msgdta ( + &UPUPRF *cat + ' ' *cat + &UPTEXT *cat + &NL *cat + &x00 + ) callprc 'printf' ( + &msgdta + ) + rtnval( &rc ) enddo enddo /* Clear away our override... */ dltovr STDOUT lvl( *JOB ) /* ...and get out of here... */ return endpgmOne specific thing to beware of is that this editor kind of trashes single- and double-quote marks under various circumstances. If you put this into a source member, look it over carefully to catch where single-quotes need to be manually typed over.
If the printed report is longer than a single page, you might consider adding a “page-heading” subroutine.
You can compile the module and create the program in any library you wish. Just be sure to use the example CRTCLMOD and CRTPGM parameters at the least. You can add additional parms, but you’ll have to debug oddities that will arise if you want to remove any from the minimum suggested parms.
Tom