View previous topic :: View next topic |
Author |
Message |
nbdtrjk1 Beginner
Joined: 12 Apr 2007 Posts: 76 Topics: 41
|
Posted: Tue Apr 28, 2009 12:03 am Post subject: Get userid from COBOL |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon May 04, 2009 12:19 pm Post subject: |
|
|
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 |
|
|
|
|