MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Program needs the TSO USERID

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Thu Oct 05, 2006 7:31 am    Post subject: Program needs the TSO USERID Reply with quote

Members,

How can i know from a Program about the TSO ID which we logged in , i mean is it possible in a program to know the TSO Userid of the person logged in ?
Back to top
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Thu Oct 05, 2006 7:33 am    Post subject: Reply with quote

Use can use ISPF services from within any mainframe program. Then, just VGET ZUSER.

O.
________
Ford Squire picture


Last edited by ofer71 on Sat Feb 05, 2011 11:50 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
mfuser
Banned


Joined: 01 Mar 2005
Posts: 105
Topics: 58

PostPosted: Thu Oct 05, 2006 7:43 am    Post subject: Reply with quote

Thanks Offer,

But how would i make use of it in the program say for example COBOL. Do i need to make any call or any syntax would help me .
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Thu Oct 05, 2006 8:22 am    Post subject: Reply with quote

mfuser,

Search the forum for "cob2job" and see what you find from the search results.

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bauer
Intermediate


Joined: 10 Oct 2003
Posts: 317
Topics: 50
Location: Germany

PostPosted: Thu Oct 05, 2006 9:26 am    Post subject: Reply with quote

mfuser,

this PL1 solution gets the userkey of user who submitts an batchjob. So if you are talking about tso batch program, transfer this coding to cobol and you get the userkey of submitter.

Code:

/* PREFIXED SAVE AREA */
DCL 1 PSA             BASED(SYSNULL()),
       2 FILLER       CHAR(548),
       2 PSAAOLD      PTR      ;

/* ADRESS SPACE CONTROL BLOCK */
DCL 1 ASCB            BASED(PSA.PSAAOLD) ,
       2 FILLER       CHAR(108) ,
       2 ASCBASXB     PTR   ;

/* ADRESS SAPCE EXTENSION BLOCK */
DCL 1 ASXB            BASED(ASCB.ASCBASXB) ,
       2 FILLER       CHAR(192) ,
       2 ASXBUSER     CHAR(7)   ;



See also:

IBM Doku, MVS Data Areas, Volumne 1 - 5
GA22-7581-01, GA22-7582-01, ......

Hank Murphy, MVS Control Blocks, McGraw-Hill, Inc,
ISBN 0-07-044309-2

HTTP://WWW.S390.IBM.COM/BOOKMGR-CGI/BOOKMGR.CMD/LIBRARY
search for: "MVS DATA AREAS"


regards,
bauer
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Thu Oct 05, 2006 11:14 am    Post subject: Reply with quote

This is a COBOL example of the ISPF VGET option:
Code:

       IDENTIFICATION DIVISION.                                         
       PROGRAM-ID...                                             
                                                                       
       ENVIRONMENT DIVISION.                                           
       INPUT-OUTPUT SECTION.                                           
                                                                       
       DATA DIVISION.                                                   
       FILE SECTION.                                                   
                                                                       
       WORKING-STORAGE SECTION.                                         
       01  VARLIST.                                                     
           03  ZUSER         PIC X(8).                             
       01  NZUSER            PIC X(7) VALUE '(ZUSER)'.           
       01  VDEFINE              PIC X(8)  VALUE 'VDEFINE'.             
       01  VGET                 PIC X(8)  VALUE 'VGET   '.             
       01  SHARED               PIC X(8)  VALUE 'SHARED '.             
       01  ASIS                 PIC X(8)  VALUE 'ASIS   '.             
       01  PROFILE              PIC X(8)  VALUE 'PROFILE'.             
       01  CHAR                 PIC X(8)  VALUE 'CHAR   '.             
       01  L8                   PIC 9(6)  VALUE 8 COMP.             
                                                                     
       PROCEDURE DIVISION.                                           
           CALL 'ISPLINK' USING VDEFINE NZUSER ZUSER CHAR L8. 
           CALL 'ISPLINK' USING VGET NZUSER ASIS.                 
           DISPLAY ZUSER.                                         
           MOVE ZEROS TO RETURN-CODE.                                 
           STOP RUN.                                                 
                                                                     
Back to top
View user's profile Send private message
ramesh_v_s
Beginner


Joined: 14 Oct 2004
Posts: 6
Topics: 3

PostPosted: Wed Sep 12, 2007 2:58 pm    Post subject: Reply with quote

Can we use this VDEFINE and VPUT in c programming? I am having to pass some values from C program to REXX. I am calling the C from REXX using LINKMVS.

Please post any working examples.

Thanks
Ramesh.
Back to top
View user's profile Send private message
superk
Advanced


Joined: 19 Dec 2002
Posts: 684
Topics: 5

PostPosted: Wed Sep 12, 2007 4:02 pm    Post subject: Reply with quote

I opened an EDIT session, entered the MODEL command on the command line, selected option 12 C - ISPF services in C/370 programs, then selected option V3 VDEFINE, which coded in the member:
Code:

 C Language calls to VDEFINE may be made by:                       
retcode = isplink ("VDEFINE ", namelist, variable, "CHAR ", length,
              "(COPY, NOBSCAN, LIST )", userdata, "LFORMAT ");     


Then, selecting V2 VPUT. I got
Code:

   C Language calls to VPUT may be made in two ways:         
                                                             
retcode = isplink("VPUT", namelist, "ASIS");                 
                                                             
                         OR                                   
                                                             
strcpy(buffer,"VPUT namelist ASIS");                         
buflen = strlen(buffer);                                     
retcode = ispexec(buflen, buffer);
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Thu Sep 27, 2007 10:39 am    Post subject: Reply with quote

Hi,

You could enter &sysuid in the parm field when the pgm is execed. Eg.:

//step10 exec=yrpgm,parm='&sysuid'

Then access the parm data in the pgm.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Thu Sep 27, 2007 6:14 pm    Post subject: Reply with quote

This thread is almost a year old. This recent activity should have been a new thread.
Back to top
View user's profile Send private message Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Fri Sep 28, 2007 12:35 pm    Post subject: Reply with quote

semigeezer wrote:
This thread is almost a year old. This recent activity should have been a new thread.
So what?

The info provided could be relevant to someone researching the same problem a year from now.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Fri Sep 28, 2007 3:24 pm    Post subject: Reply with quote

How will a searcher know that they can find information about using ISPF services from C when the title is "Program needs the TSO USERID"? I agree that information relevant to the original question (like that which you provided) is appropriate for reasons you mentioned, but the update to this post had almost nothing to do with the original question.
Back to top
View user's profile Send private message Visit poster's website
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Sun Sep 30, 2007 11:50 am    Post subject: Reply with quote

Your orig post said:
Quote:
This thread is almost a year old. This recent activity should have been a new thread.

It implies that it is too old to be updated or appended.

Given what you said in your follow-up post, this orig may have been more appropriate:
Quote:
If you want to go off topic, start another thread.

_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group