IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Assembler calling COBOL85


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Thu Oct 07, 2010 10:07 pm
Reply with quote

I have an assembler program (VM environment) that calls multiple COBOL74 subprograms. I am converting one of these subprograms to COBOL85. Currently the assembler program uses VCON (V(pgmname)) to load and call the subprograms.

Is it possible to compile the COBOL85 program and catalog as an object, and be able to run the assembler program unchanged (still using the VCON address to call)?.

I've been able to catalog the COBOL85 program as an object and the link seems to work fine, but am abending at runtime.

Any ideas?

Thanks.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Thu Oct 07, 2010 10:45 pm
Reply with quote

Are you using an LE-compliant COBOL compiler?

If you're unsure, what is your version of COBOL?

Are you getting any CEE* prefixed-messages on the console during execution?

You may have to make the Assembler program temporarily LE-compliant via CEEPIPI (Batch only - not CICS), if the COBOL compiler is LE-compliant.

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Oct 07, 2010 11:19 pm
Reply with quote

Hello,

Which abend occurs?
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Thu Oct 07, 2010 11:22 pm
Reply with quote

COBOL version is IBM VS COBOL II Release 4.0.

No CEE messages output from job.

Not sure, but I don't think the COBOL compiler is LE compliant. How would I know.
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Thu Oct 07, 2010 11:34 pm
Reply with quote

Dick, part of the problem is that I don't see any abend code that I would normally expect.

Here's the console output:
Code:

F1 0001 0S00I JOB RP1100   CANCELED
F1 0001 0S07I PROBLEM PROGRAM  PSW = 07CD0000 00501454
F1 0001 4A87I AUTOMATIC CLOSE HAS BEEN STARTED

F1 0001 4A88I AUTOMATIC CLOSE FOR 5 FILE(S) COMPLETED

F1 0001 1S78I  JOB TERMINATED DUE TO  PROGRAM ABEND
F1 0001 EOJ RP1100


And some of the dump info:

Code:

1S54I  PHASE WDD1100  IS TO BE FETCHED FROM TEST.PROJ
JOBNAME=RP1100    PDUMP     DATE=07/10/2010  TIME=11:12:14  CPUID=FF36476C 20868000  COMP=5686CF80691C  PAGE       1

PSW      07CD0000 0050126E

GR 0-7   00501624 00501670 007B8FFF 00500000 00500938 004EE4E0 005009B8 40501264
   8-F   00501078 004EE618 00595D48 007B8FFF 00500078 60500078 0059F890 00501262

AR 0-7   00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
   8-F   00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

FP 0-3   40404040 40404040 40404040 40404040 40404040 40404040 40404040 40404040

PDUMP 005015D8 - 00501620
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Oct 07, 2010 11:51 pm
Reply with quote

part of the problem ids that the environment is not mvs/zOS
the f1 at the left of the messages looks suspicious
and
Quote:
PHASE WDD1100 IS TO BE FETCHED FROM TEST.PROJ

confirms it
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Oct 08, 2010 12:23 am
Reply with quote

Can you compile the COBOL program using options LIST,NOOFFSET? This will generate the Assembler instructions.

In the DUMP, go to X'0050126E' (don't know why an ILC was not displayed for the PSW info) and tell us what you find as it is the address of the next sequential instruction. Looks like this address will be within R8 addressability.

VS/COBOL II was not LE compliant. COBOL/370 (it's predecessor) did have LE integrated into its compiler and was the initial COBOL compiler to do so.

As soon as you get to the instruction at the above address, decrypt it and then using the Assembler expansion, find this instruction in the listing and then go backwards and look at the previous instruction. This will be your failed instruction.

Hopefully, there aren't any duplicate instruction sequences in the program. icon_rolleyes.gif

Do you have a Yellow Card?

How's your Assembler?

Bill
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 12:45 am
Reply with quote

Enrico, I did mention that the environment is VM, why is that part of the problem?


Bill, thanks, I'll give that a go. Not sure how far I'll get with ...

"decrypt it and then using the Assembler expansion"

Don't have a Yellow Card (had to look it up to even know what it is icon_biggrin.gif) Last time I looked at Assembler was around 1991 (in school), so I guess you could say it is very limited.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Oct 08, 2010 1:00 am
Reply with quote

Whatever is at that address, post these bytes, for a total of eight (to be sure). One of us curmudgeon's should be able to decrypt them into an actual formatted instruction.... icon_wink.gif

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 08, 2010 1:12 am
Reply with quote

Hello,

Is this only VM or is this a DOS/VSE guest running under VM?

The "F1" messages surely resemble dos messages for something running in the Foreground 1 partition. . .

Or does VM use the same message format as dos?
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 1:15 am
Reply with quote

Dump info:

Code:

00501240 005005B0 0050076F 00501456 D6D7C5D5 C6C9D5C4 D9C5C1C4 C6D9C5C5 005011F8        .&...&.?.&..OPENFINDREADFREE.&.8
00501260 00000570 4110740C 410073C0 0A0295D5 71F24780 70B2D222 73C8727F 5810741C        ..............nN.2....K..H."....
00501280 58F10010 17EE05E0 12EE4720 E0080A82 45EF000C D22273C8 71F35810 741C58F1        .1.............b....K..H.3.....1


I believe this is what you need? I think this gets me pretty close, but am interested to see your 'decrypting' results. icon_smile.gif
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Oct 08, 2010 1:32 am
Reply with quote

The next sequential instruction is a Load Address (Op Code 41) and it should format in your Assembler expansion as -

Code:

         LA     0,X'3C0'(0,7)


An RX (Register to Index) type instruction. (X'410073C0').

The second operand index-register (X2 in schematic) is 0.

"Register 0 is loaded with the address found at X'3C0' off Register 7".

From the POPS manual -

Quote:

LA R1,D2(X2,B2) [RX]

________ ____ ____ ____ ____________
| '41' | R1 | X2 | B2 | D2 |
|________|____|____|____|____________|
0 8 12 16 20 31

Looks like the instruction following the LA is an SVC (Op Code 0A).

Are you doing any file stuff or calling VSE functions?

Bill
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 2:02 am
Reply with quote

dick scherrer wrote:

Is this only VM or is this a DOS/VSE guest running under VM?


I believe you're right, my technical side is not as strong as it could be, mostly a coder/tester.

Dick, thanks, I will do some more digging.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Oct 08, 2010 6:02 am
Reply with quote

OK, I messed up. Can't count too well. icon_redface.gif

It looks like your program is abending on an SVC 2 (X'0A02'), because the NSI address is X'0050126E' (see below).

Review your expanded Assembler instructions and look for the SVC 2. I'm not sure what that is in a VSE environment.

The NSI address points to a CLI "Compare Logical Immediate" (X'95D571F2'), which formats to -

Code:

         CLI   X'1F2'(7),X'D5'

"Compare the value at X'1F2' off Register 7 with a X'D5'" (C'N')

So, kindly disregard my previous post about the Load Address.

However, keep in mind that the Load Address is the instruction before the SVC and the CLI is the instruction after the SVC.

Bill
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 08, 2010 7:09 am
Reply with quote

Hello,

From the z/VSE V4R2 Supervisor Calls and Internal Macros manual:

Quote:
SVC 2 (X'02')
Fetches a logical transient ($$B- or B-Transient).
Loads a B-transient from the SVA, the IJSYSRS.SYSLIB sublibrary (SYSLIB) or
one of the concatenated private sublibraries (PSUBLIB) into the Logical Transient
Area (LTA) and enters the logical transient at its load address plus 8 bytes. The
directory entry for the phase may be found in the SDL, in the SYSLIB directory, or
in one of the PSUBLIB directories (if there are concatenated sublibraries). For a
more detailed description, refer to z/VSE Supervisor Diagnosis Reference,Chapter
"Program Retrieval".
If the VSE/Advanced Functions "Fast B- and C-Transient Fetch" is supported, the
logical transients can be loaded into the LTA without activating the Fetch (FCH)
system tasks.
The SVC 2 (X'02) routine moves the phase from the SVA directly into the LTA if all
of the following conditions are met:
 The directory entry of the phase has been found in the SDL.
 The directory entry of the phase has already been activated.
 The phase resides in the SVA and it is self-relocatable.


That manual is here:
public.dhe.ibm.com/eserver/zseries/zos/vse/pdf3/zvse42/FB8SUM22.pdf

Lots of vse documentaton here:
www-03.ibm.com/systems/z/os/zvse/documentation/
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 8:11 pm
Reply with quote

These are the lines of code where it's abending.

Code:

LA    0,PSWDUMP
SVC   2
CLI   EOFIND,C'N'


It's part of an abend routine I think. I commented out the line that calls the abend routine to see if I could get a better dump. Also put some messages to the console in different spots to figure out where it's abending. Narrowed it down (I think) to the actual call to the COBOL85 subprogram.

Code:

LR    RF,RA                 
CALL  (15),(RECORD,RETCODE,MCBLIST)


Here's the beginning of the new dump. Looks to me like it might be getting into the called program?

Code:

0S03I PROGRAM CHECK INTERRUPTION  - HEX LOCATION 00000000 - INTERRUPTION CODE 01 - OPERATION EXCEPTION
0S00I JOB RP1100   CANCELED
0S07I PROBLEM PROGRAM  PSW = 079D0000 00000002

SYMPTOM RECORD

003C4000 00000001 E2D9F2F0 F8F6F3F6 F4F7F6C3 F0F97AF2 F87AF3F1 7AF0F0F1 F061F1F0   00   ....SR208636476C09:28:31:0010/10
003C4020 61F0F8F1 F47AF2F8 7AF3F17A F0F0F5F6 F8F6C3C6 F8F0F6F9 F1C34000 E2C3D7D9        /0814:28:31:005686CF80691C .SCPR
003C4040 C5D84040 00000000 00000000 003F0074 000000B3 002B00B3 000000DE 00000000        EQ  ............................
003C4060 00000000 00000000 00000000 00000000 00000000 00000000 C1C261E2 F2F0F0F0        ........................AB/S2000
003C4080 40D9C5C7 E261F0C6 F0F0F240 D9C5C7E2 61F0F0F0 F0F240D4 E261F0E2 F0F3C940         REGS/0F002 REGS/00002 MS/0S03I
003C40A0 C1C4D9E2 61F0F0F0 F0F0F0F0 F240C1C2 61E2F0F0 F0F140D1 D6C26DD5 C1D4C57E        ADRS/00000002 AB/S0001 JOB_NAME=
003C40C0 D9D7F1F1 F0F04040 40C4E4D4 D7C5C46D C4C1E3C1 7EC6F460 D7C1D9E3 C9E3C9D6        RP1100   DUMPED_DATA=F4-PARTITIO
003C40E0 D540                                                                           N

PSW AND REGISTERS OF ENDING TASK

PSW      079D0000 00000002



Dick, thanks for those links.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Oct 08, 2010 8:30 pm
Reply with quote

An Operation Exception (S0C1) indicates an invalid Op Code (Instruction) was hit.

I thought you said the Assembler program was issuing a VCON to the COBOL program? This implies that you're performing a STATIC Call and when you Assembled the Assembler program, the COBOL program became part of the entire PHASE (Load Module).

IIRC, the CALL Macro is Dynamic and expands to a BALR 14,15, with R15 containing the LP address of the COBOL program as an ADCON (as you've coded (15)).

Before the CALL are you issuing a CDLOAD of the COBOL Phase to get the LP address?

Please correct me if I'm wrong because MVS and VSE have their differences.

Bill
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 9:04 pm
Reply with quote

Here's the code before the CALL:

Code:

SR    R0,R0
SVC   4
L     RA,12(R4)



R4 points to this:
Code:

DC    CL4'ANC',CL8'PGMNAME',V(PGMNAME)


To me, that means 12(R4) is pointing to the VCON address, right?

You're right, the CALL expands to a BALR 14,15.

The COBOL85 program is linked in as follows:

PHASE,assemblermainline
INCLUDE assemblermainline
INCLUDE othersubpgm
INCLUDE othersubpgm
PHASE, cob85sub <---this is the one converted to COBOL85
INCLUDE cob85sub
INCLUDE othersubpgm
INCLUDE othersubpgm

If it's in the link as a phase, does that make it a dynamic call?

Sorry, probably tough for you guys to help me out when you have so little details.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Oct 08, 2010 9:16 pm
Reply with quote

Hello,

Were there any warnings in the linkedit printout?

Sometimes an 0c1 happens when x'00' is executed because the code is not "there".
Back to top
View user's profile Send private message
rpenner

New User


Joined: 26 Apr 2006
Posts: 22
Location: Canada

PostPosted: Fri Oct 08, 2010 9:59 pm
Reply with quote

No link warnings. The link shows the COBOL85 object being brought in from the correct library.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts Build dataset list with properties us... PL/I & Assembler 4
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top