View previous topic :: View next topic
|
Author |
Message |
ramvishwa Warnings : 2 New User
Joined: 18 Dec 2006 Posts: 18 Location: bangalore
|
|
|
|
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 |
|
|
Deru Sudibyo Currently Banned New User
Joined: 30 Nov 2007 Posts: 6 Location: Indonesia
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
|