Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

link cobol program to assembler program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
ramvishwa
Warnings : 2

New User


Joined: 18 Dec 2006
Posts: 18
Location: bangalore

PostPosted: Mon Dec 03, 2007 6:50 pm    Post subject: link cobol program to assembler program
Reply with quote

Code:
RO        EQU    0
R1        EQU    1
R2        EQU    2
R3        EQU    3
R4        EQU    4
R5        EQU    5
R6        EQU    6
R7        EQU    7
R8        EQU    8
TCTUAPTR  EQU    9
TIOABAR   EQU    10
R11       EQU    11
R12       EQU    12
R13       EQU    13
R14       EQU    14
R15       EQU    15
            COPY   DFHCSADS
            COPY   DFHTCADS
            COPY   DFHTCTTE
DFHEISTG  DSECT
PACKED    DS     D
WORKAREA  DS     CL8
COMMREG   DSECT
          USING *,R7
COMMIND   DS     CL1
COMMOBRN  DS     CL4
REFBRAN   CSECT
  EXEC CICS ADDRESS TCTUA(TCTUAPTR)
  EXEC CICS GETMAIN SET(R7) LENGTH(LEN) INITIMG(BLANK)
          LH     R5,63(TCTUAPTR)
          CVD    R5,PACKED
          MVC    WORKAREA,EDITPATT
          ED     WORKAREA(8),PACKED+4
          MVC    COMMOBRN(4),WORKAREA+4
BLANK     DC     C' '
LEN       DC     H'05'
EDITPATT  DC     XL8'4021202020202020'
          END

**************************************************************************

I have cobol program that link a assembler program
Below the commarea of cobol program

Code:
05 COMMREG.
   10 COMM-IND PIC X(1).
   10 COMM-BRN PIC X(4).

Below is the cics command to link

Code:
EXEC CICS LINK
PROGRAM('REFBRAN')
COMMAREA(COMREG) LENGTH(5)
END-EXEC.

The assembler source is mentioned above and i am new to assembly language.

Will my program return the data from TCTUA area to the calling cobol program.

correct my program, if i am wrong and thanks in advance.
Back to top
View user's profile Send private message

Deru Sudibyo
Currently Banned

New User


Joined: 30 Nov 2007
Posts: 6
Location: Indonesia

PostPosted: Thu Dec 20, 2007 7:02 am    Post subject:
Reply with quote

Is it just illustration or your real stuff? If it real, REFBRAN will be S0C1 when executed. What you expect by issueing CICS LINK
PROGRAM('REFBRAN') ?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Mon Jan 21, 2008 11:40 pm    Post subject: link cobol program to assembler program
Reply with quote

Several things -

01) Specifically use DFHEIENT (and avoid the default) instead of a CSECT. It's a cleaner approach and the CSECT will be built for you.
02) I don't see R7 being loaded by DFHEICAP (commarea addressability).
03) You don't need the GETMAIN, nor DFHCSADS and DFHTCTTE.

FWIW, this can be done easily in the COBOL CICS program.

Code:

    03  WS-PATTERN     PIC  9(005).
    03  WS-TCTUAL-LGTH PIC  9(004) BINARY.

LINKAGE SECTION.
01  LS-TCTUA-REC.
    03  FILLER         PIC  X(063).
    03  LS-TCTUA-HWORD PIC  9(004) BINARY.

EXEC CICS ASSIGN TCTUALENG(WS-TCTUAL-LGTH) END-EXEC.
*
EXEC CICS ADDRESS TCTUA(ADDRESS OF LS-TCTUA-REC) END-EXEC.

MOVE LS-TCTUA-HWORD TO WS-PATTERN.

I'm assuming that the TCTUA Length is a minimum of 65-bytes. You can verify the length via an ASSIGN TCTUALENG command.

If it's less than 65, then you'll get a S0C4.

The PATTERN only needs to be 5-bytes, because the largest signed-halfword value is +32767 and the largest unsigned value is 65535.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts Dump analysis of an assembler module monica1 PL/I & Assembler 4 Tue May 09, 2017 10:05 am
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us