Retrieving &SYSUID



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Retrieving &SYSUID

Postby Puffe » Mon May 02, 2011 4:20 pm

Hi,

I know that I can use symbol parameter &SYSUID in a sequential filename and together with the NOTIFY-statement.
But, now I wonder if it's possible to get the actual value from &SYSUID and put it in a record in a sequential file ??

Yours sincerely,

Mikael
Puffe
 
Posts: 21
Joined: Mon May 02, 2011 1:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Retrieving &SYSUID

 

Re: Retrieving &SYSUID

Postby Robert Sample » Mon May 02, 2011 4:39 pm

Write a short program in the language of your choice to take the value from the PARM= and write it to the file. The user id is substituted in PARM='&SYSUID' and becomes available to the program.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Retrieving &SYSUID

Postby steve-myers » Mon May 02, 2011 5:56 pm

To extend Mr. Sample's idea: the userid is available in a control block called the ACEE, which any program can locate, though it's not easy. While the ACEE is considered to be a RACF control block, the other two major security systems (ACF2 and Top Secret) maintain an ACEE and fill in at least basic security data, though not as much as RACF, and that includes the userid.
steve-myers
Global moderator
 
Posts: 1885
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 197 times

Re: Retrieving &SYSUID

Postby prino » Mon May 02, 2011 7:14 pm

In REXX:
ascb = storage(224,4)                             /* psaaold  */
asxb = storage(d2x(c2d(ascb) + 108),4)            /* ascbasxb */
                                                  /*___racf___*/
acee = storage(d2x(c2d(asxb) + 200),4)            /* acee     */
unam = storage(d2x(c2d(acee) + 100),4)            /* aceeunam */
user_name = strip(storage(d2x(c2d(unam) + 1),20))


In PL/I, from a running job:

dcl p1               ptr init (ptrvalue(16)) static;
dcl 1 s1 based(p1),
      2 p2           ptr;
dcl 1 s2 based(p2),
      2 p3           ptr;
dcl 1 s3 based(p3),
      2 *            ptr,
      2 tcb_ptr      ptr;
dcl 1 tcb based(tcb_ptr),
      2 *(3)         ptr,
      2 tiot_ptr     ptr,
      2 *(41)        ptr,
      2 jscb_ptr     ptr;
dcl 1 tiot based(tiot_ptr),
      2 jobname      char (8),
      2 stepname     char (8);
dcl 1 jscb based(jscb_ptr),
      2 *(65)        ptr,
      2 jscbjct      ptr,
      2 *(13)        ptr,
      2 jscbssib     ptr;
dcl 1 jct based(jscbjct),
      2 *(5)         ptr,
      2 *            char,
      2 jctjstat     bit  (8),
      2 *            char (2),
      2 jctjname     char (8),            /* job name                */
      2 *(4)         ptr,
      2 jctsdkad     char (3),            /* sva of first sct        */
      2 *            char,
      2 jctjctx      char (3),            /* sva of jctx             */
      2 *            char,
      2 jctactad     char (3),            /* sva of first act        */
      2 *            char,
      2 *(26)        ptr,
      2 *            char,
      2 jmrjmrjd     fixed dec(5,3),      /* job start date (julian) */
      2 *(2)         ptr,
      2 jctuser      char (7),            /* job user id             */
      2 *            char,
      2 jctacode     char (4);            /* job abend code          */
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 536
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Retrieving &SYSUID

Postby Frank Yaeger » Tue May 03, 2011 12:33 am

Mikael,

You can use a DFSORT job like the following to do what you asked for:

//S1 EXEC PGM=SORT,PARM='JP1"&SYSUID"'
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC BUILD=(JP1)
/*


For complete information on this technique, see "SET and PROC symbols in control statements" at:

http://www.ibm.com/support/docview.wss? ... g3T7000242
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Retrieving &SYSUID

Postby Puffe » Tue May 03, 2011 10:34 am

I've tried your solution Frank but I couldn't get it to work.
I got rc=16.

I wrote following

//STEP02   EXEC SORT,PARM='JP1"&SYSUID"'
//*                                     
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD *                         
RECORD                                   
//SORTOUT  DD DSN=MIKE.TEST.USERID1,     
//            DISP=(,CATLG),             
//            DATACLAS=TL               
//SYSIN    DD *                         
  OPTION COPY                           
  INREC BUILD=(JP1)                     
/*     


The result from the execution

ICE067I 0 INVALID PARAMETER IN JCL EXEC PARM OR INVOKED PARM LIST 
            OPTION COPY                                           
            INREC BUILD=(JP1)                                     
                         Ã…                                         
ICE007A 1 SYNTAX ERROR
Puffe
 
Posts: 21
Joined: Mon May 02, 2011 1:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Retrieving &SYSUID

Postby Puffe » Tue May 03, 2011 5:24 pm

At my company we haven't upgrade to the version where I can use JPx-commands.

We have version
ICE201I G
Puffe
 
Posts: 21
Joined: Mon May 02, 2011 1:41 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Retrieving &SYSUID

Postby Frank Yaeger » Tue May 03, 2011 10:24 pm

Yes, that would explain it. Ask your System Programmer to install z/OS DFSORT V1R10 PTF UK90025 or z/OS DFSORT V1R12 PTF UK90026 (Oct, 2010)
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post