Cobol call Assembler to open file, return S0C4?

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
chmarmot
Member
Posts: 4
Joined: Sat Mar 31, 2012 11:20 am

Cobol call Assembler to open file, return S0C4?

Post by chmarmot » Sat Mar 31, 2012 11:25 am

I write a COBOL program to call a Assembler program(open a QSAM file). It returns S0C4 at the SVC 19(OPEN) Instruction. When I use the Assembler program separately, it's OK. It's there anything wrong?

COBOL program(compile with IBM Enterprise COBOL for z/OS 4.2.0):
CALL 'QSAMIOA1' USING PASS-AREA

Assembler program(compile with HLASM R6.0):
OPEN (QSAMFILE,(INPUT))
.....
QSAMFILE DCB DSORG=PS,MACRF=GL,EODAD=EODRTN,SYNAD=ERROR1,
DDNAME=QSAMFILE

User avatar
dbzTHEdinosauer
Moderator
Posts: 981
Joined: Mon Oct 02, 2006 8:31 pm

Post by dbzTHEdinosauer » Sat Mar 31, 2012 4:29 pm

AMODE/RMODE of both?
Dick Brenholtz
JCL, SQL and code in programs have an irritating habit of doing what you say,
not what you meant.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Apr 01, 2012 3:49 am

Why not open the file in the cobol program (why use assembler)?

Is there an open/read in the cobol code?
Have a good one

chmarmot
Member
Posts: 4
Joined: Sat Mar 31, 2012 11:20 am

Post by chmarmot » Sun Apr 01, 2012 6:15 am

AMODE 31
RMODE ANY

I want to use the Assembler program to SUB JCL and get JOBID. The OPEN return a S0C4, then I open a QSAM file for test.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Apr 01, 2012 8:05 am

This does not explain why you want to open a file in the assembler code. . .

What JCL do you want to SUB? How do you get the "JOBID"?

Ia the file being opened in the assembler code to be read or written in the cobol code?

It may help someone help you if you more clearly explain just what you want this process to do and how the cobol relates to the assembler.
Have a good one

chmarmot
Member
Posts: 4
Joined: Sat Mar 31, 2012 11:20 am

Post by chmarmot » Sun Apr 01, 2012 10:47 am

Thanks for reply.
This is just for test. You can see the sample on http://www.simotime.com/qsamio01.htm. I just can't run it right.

DikDude
Moderator
Posts: 1001
Joined: Fri Jul 22, 2011 8:39 am
Location: usa

Post by DikDude » Sun Apr 01, 2012 11:11 am

Make sure that both modules are error free when compiled/assembled.
Make sure both linkedits were successful.
Make sure the run jcl reflects all of the needed dd statements.

Make a copy of the assembler code and remove the code that deals with the file. See if the cobol code can successfully invoke this code.
Have a good one

chmarmot
Member
Posts: 4
Joined: Sat Mar 31, 2012 11:20 am

Post by chmarmot » Sun Apr 01, 2012 1:17 pm

I'm sure both modules is ok. I can run them separately.
If I remove the code that deals with file, It's OK.
I think the compile options for the Assembler program may be error, but I can't found any clues in IBM's book nor Internet.
Nevertheless, thanks for reminding.

NicC
Active Member
Posts: 650
Joined: Sun Jul 24, 2011 5:27 pm
Location: Down on the pig farm

Post by NicC » Sun Apr 01, 2012 2:38 pm

Well, you don't compile assembler programs so there are no compile options involved. How about assembler options for assembling your assembler code?
Regards
Nic

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others