Page 2 of 2
Re: Getting USERID while within the COBOL program
Posted:
Thu Feb 25, 2010 1:28 am
by dick scherrer
Hello,
Sorry that i stepped on my hand with the copy/paste. . .
I changed the code to be all upper case and it compiles and runs with no problems. . .
but I feel at a disadvantage (this stuff wasn't taught in my cobol class lol )
Nor most likely anyone else's
Does the 0c4 happen with the GSF code also?
Re: Getting USERID while within the COBOL program
Posted:
Thu Feb 25, 2010 6:29 pm
by ctrevino
Yes, the gsf code gave the same S0C4. Right now, I am trying to get the assembler program to identify displacements in our system compiled. (had to get the systems programmers to help with this as they keep us developers on a short leash).
I was thinking that maybe the displacements are different in our shop since the code works on your system.
Re: Getting USERID while within the COBOL program
Posted:
Thu Feb 25, 2010 6:45 pm
by Robert Sample
This definitely sounds like something specific to your site is going on. Although it is possible, if the displacements for these areas is not the same for your site as other sites, your operating system would have problems running. z/OS doesn't move those displacements around -- for very good reasons.
Re: Getting USERID while within the COBOL program
Posted:
Fri Feb 26, 2010 1:00 am
by dick scherrer
Hello,
What level of z/OS is being run there?
Have you isloated which instruction is causing the 0c4? I suspect that the code is trying to move "something" to address zero (or some other low address).
Re: Getting USERID while within the COBOL program
Posted:
Fri Feb 26, 2010 10:10 pm
by ctrevino
I had to share. The credit goes with David Andrews. He selflessly sent me this code and it worked like a charm. Now all I have to do is have my subroutine call EXCI-CICS and do http PUT to an Atom Processing Protocol. (not much,.
) But the solution to my userid problem is below.
IDENTIFICATION DIVISION. 00030000
00040000
PROGRAM-ID. 00050000
ACEETEST. 00060000
00070000
AUTHOR. 00080000
DAVID ANDREWS. 00090000
00100000
DATE-WRITTEN. 00110000
FEBRUARY 2010. 00120000
00130000
**** 00140000
**** Figure out my own userid. 00150001
**** 00190000
00200000
ENVIRONMENT DIVISION. 00210000
00220000
DATA DIVISION. 00230000
00231000
WORKING-STORAGE SECTION. 00232000
00233000
01 TWO-BYTES. 00234000
05 FIRST-BYTE PIC X. 00235000
05 SECOND-BYTE PIC X. 00236000
01 USERID-LENGTH REDEFINES TWO-BYTES PIC S9999 COMP. 00237000
00240000
LINKAGE SECTION. 00810000
00820000
01 PSA. 01000000
05 PIC X(540). 01010001
05 PSATOLD POINTER. 01020000
05 PIC X(4). 01021001
05 PSAAOLD POINTER. 01022001
01030000
01 ASCB. 01031001
05 PIC X(108). 01032001
05 ASCBASXB POINTER. 01033001
01034001
01 ASXB. 01035001
05 PIC X(200). 01036001
05 ASXBSENV POINTER. 01037001
01038001
01 ACEE. 01080000
05 PIC X(20). 01081001
05 ACEEUSRL PIC X. 01090000
05 ACEEUSRI PIC X(8). 01090100
01091000
01091400
01460000
PROCEDURE DIVISION. 01470000
01480000
MAIN. 01490000
01500000
SET ADDRESS OF PSA TO NULL. 01560000
SET ADDRESS OF ASCB TO PSAAOLD IN PSA. 01570001
SET ADDRESS OF ASXB TO ASCBASXB IN ASCB. 01571001
SET ADDRESS OF ACEE TO ASXBSENV IN ASXB. 01580001
01581100
MOVE ZERO TO USERID-LENGTH. 01581200
MOVE ACEEUSRL IN ACEE TO SECOND-BYTE. 01581300
DISPLAY 'USERID LENGTH=' USERID-LENGTH UPON CONSOLE 01581401
DISPLAY ACEEUSRI(1:USERID-LENGTH) UPON CONSOLE. 01581501
GOBACK. 01590000
END PROGRAM ACEETEST. 02560000
Re: Getting USERID while within the COBOL program
Posted:
Sat May 15, 2010 11:40 pm
by sholton
Compile options --might-- cause an issue, if you compiled with AMODE(24). Some control blocks are in AMODE(31) space, and if your compile/link is AMODE(24), you will likely get an abend0C4 attempting to access these blocks (either the abend or garbage, if the "modulo 2**24 address of the 31 bit "real" address happens to hit on some data laying around in your AMODE(24) space...)
You don't specify which version of z/OS you are running, or if you ARE running z/OS??