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 

Get userid from COBOL

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


Joined: 12 Apr 2007
Posts: 76
Topics: 41

PostPosted: Tue Apr 28, 2009 12:03 am    Post subject: Get userid from COBOL Reply with quote

I searched in the forum and got the below code
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.               

After executing the above code, i got null values in the ZUSER field

Please let me know what is wrong in that

Thanks
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue Apr 28, 2009 12:49 am    Post subject: Reply with quote

nbdtrjk1,

Start reading from this post and see if you set the batch tso environment properly

http://www.mvsforums.com/helpboards/viewtopic.php?p=16694#16694

You can also try the method listed here

http://www.mvsforums.com/helpboards/viewtopic.php?t=1657&highlight=cob2job

kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Mon May 04, 2009 12:19 pm    Post subject: Reply with quote

A cheap alternative is to use &SYSUID as a PARM parameter in your EXEC statement, then access it via the LINKAGE SECTION in your program.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
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