Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

To get the RACF ID in COBOL program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1626
Location: NY,USA

PostPosted: Fri Jul 06, 2012 8:05 pm    Post subject: To get the RACF ID in COBOL program
Reply with quote

How can we get the RACF ID of the user who is running the current program, its plain COBOL batch program?
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 06, 2012 8:11 pm    Post subject:
Reply with quote

why do you want it?

and its is the possessive form
it's = it is
and don't feel bad, nearly 80 percent of native english speakers
make the same mistake.
Back to top
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Fri Jul 06, 2012 8:17 pm    Post subject:
Reply with quote

If you Google e.g. "cobol userid" you will find what you are looking for!
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Jul 06, 2012 8:27 pm    Post subject:
Reply with quote

Hello,

If the job is running as Production, it will probably have an id related to the Job Scheduler or Computer Operations . . . fwiw
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Sat Jul 07, 2012 12:31 am    Post subject: Reply to: To get the RACF ID in COBOL program
Reply with quote

A callable Assembler sub-program is another method -

Code:

*PROCESS RENT                          PROGRAM IS RE-ENTRANT
***********************************************************************
*        THIS SUB-PROGRAM IS CALLED, USING THE FOLLOWING SYNTAX -     *
*                                                                     *
*        03  WS-GETUSER                PIC  X(08)  VALUE 'GETUSER'.   *
*        03  WS-GETUSER-PARM.                                         *
*            05  WS-GETUSER-ID         PIC  X(08).                    *
*            05  FILLER                PIC  X(72).                    *
*                                                                     *
*        CALL WS-GETUSER               USING WS-GETUSER-PARM.         *
*                                                                     *
*        UPON RETURN, IF THE COBOL 'RETURN-CODE' SPECIAL-REGISTER IS  *
*        ZERO, THEN 'WS-GETUSER-ID' WILL CONTAIN THE VALUE OF THE     *
*        JOB-CARD 'USER'. OTHERWISE, THERE WAS A PROBLEM EXTRACTING   *
*        THE USERID FROM THE CONTROL-BLOCKS.                          *
***********************************************************************
         PRINT NOGEN                   SUPPRESS MACRO EXPANSION
         CVT   DSECT=YES,LIST=YES,     CVT-DSECT (PREFIX=YES)          X
               PREFIX=YES
         IHAACEE                       ACEE-DSECT
         IHAASXB                       ASXB-DSECT
         IHAASCB                       ASCB-DSECT
         PRINT GEN                     ACTIVATE MACRO EXPANSION
PRMDSECT DSECT
         USING *,R7                    INFORM ASSEMBLER
PRMUSER  DS    CL8                     USERID RETURNED TO CALLER
PRMREGSA DS    XL72                    REGISTER SAVEAREA
GETUSER  CSECT
         USING *,R3                    INFORM ASSEMBLER
         SAVE (14,12)                  SAVE REGISTERS
         LA    R3,0(,R15)              CSECT ADDRESSABILITY
         L     R7,0(,R1)               PARM-ADDRESSABILITY
         XC    PRMREGSA,PRMREGSA       ENSURE X'00'S
         LA    R15,PRMREGSA            POINT TO OUR SAVEAREA
         ST    R13,4(,R15)             BACKWARD-CHAIN
         ST    R15,8(,R13)             FORWARD-CHAIN
         LR    R13,R15                 POINT TO OUR SAVEAREA
         L     R1,CVTPTR               CVT-ADDRESS
         L     R1,0(,R1)               ADDRESS OF TCB POINTERS
         L     R1,12(,R1)              POINT TO 'ASCB'
         L     R1,ASCBASXB-ASCB(,R1)   CHAIN TO 'ASXB' ADDRESS
         L     R1,ASXBSENV-ASXB(,R1)   CHAIN TO 'ACEE' ADDRESS
         USING ACEE,R1                 INFORM ASSEMBLER
         MVC   PRMUSER,ACEEUSRI        POPULATE PARM-USERID
         DROP  R1                      DROP ADDRESSABILITY
         XR    R15,R15                 ENSURE X'00'S
         CLC   PRMUSER,=CL8' '         EXCEEDS SPACES?
         BH    RTN2CLLR                YES, RETURN TO THE CALLER
         LA    R15,16                  SET NON-ZERO RETURN-CODE
RTN2CLLR EQU   *
         L     R13,4(,R13)             RESTORE CALLER'S R13
         XC    PRMREGSA,PRMREGSA       ENSURE X'00'S
         RETURN (14,12),RC=(15)        RESTORE AND RETURN
         LTORG ,
         YREGS ,
GETUSER  AMODE 31
GETUSER  RMODE ANY
         END   ,                       END 'GETUSER'

HTH....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us