View previous topic :: View next topic
|
Author |
Message |
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi All,
I have a simple COBOL/CICS program. If I enter some values after executing this I am getting Junk values as output instead of the values I entered. Please correct the program...
IDENTIFICATION DIVISION.
PROGRAM-ID. PMTRGA23.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
COPY MAP.
01 WS-COMM.
05 VAL PIC X(4).
01 WS-DATA.
05 WS-NAME PIC X(8).
05 WS-PSWRD PIC X(6).
LINKAGE SECTION.
01 DFHCOMMAREA.
05 VAR PIC X(4).
PROCEDURE DIVISION.
IF EIBCALEN = 0
PERFORM SEND-MAP
PERFORM TRANS-MAP
ELSE
PERFORM RECEIVE-MAP
PERFORM SEND-DATA-MAP
PERFORM TRANS-END-MAP
END-IF.
STOP RUN.
SEND-MAP.
MOVE LOW-VALUES TO HEADERO.
EXEC CICS SEND
MAP('HEADER')
MAPSET('MAPS23')
END-EXEC.
TRANS-MAP.
MOVE 'XXXX' TO VAL OF WS-COMM.
EXEC CICS RETURN
TRANSID('TN23')
COMMAREA(VAL)
LENGTH(4)
END-EXEC.
RECEIVE-MAP.
EXEC CICS RECEIVE
MAP('HEADER')
MAPSET('MAPS23')
INTO(HEADERI)
END-EXEC.
MOVE NAMEI TO WS-NAME.
MOVE PSWRDI TO WS-PSWRD.
SEND-DATA-MAP.
EXEC CICS SEND
FROM(WS-DATA)
ERASE
END-EXEC.
TRANS-END-MAP.
EXEC CICS
RETURN
END-EXEC.
The Copy book of MAP is as follows....
01 HEADERI.
02 FILLER PIC X(12).
02 NAMEL COMP PIC S9(4).
02 NAMEF PICTURE X.
02 FILLER REDEFINES NAMEF.
03 NAMEA PICTURE X.
02 NAMEI PIC X(9).
02 PSWRDL COMP PIC S9(4).
02 PSWRDF PICTURE X.
02 FILLER REDEFINES PSWRDF.
03 PSWRDA PICTURE X.
02 PSWRDI PIC X(11).
01 HEADERO REDEFINES HEADERI.
02 FILLER PIC X(12).
02 FILLER PICTURE X(3).
02 NAMEO PIC X(9).
02 FILLER PICTURE X(3).
02 PSWRDO PIC X(11).
Thanks in advance,
Reddy. |
|
Back to top |
|
|
Hanfur
Active User
Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Are u returning to CICS with COMMAREA in para TRANS-END-MAP?
Also its good practise to intialise the mapdata before senting first time ;probably u may want to move LOW-VALUES to map the need to send the Map....
-Han. |
|
Back to top |
|
|
M.Bhavani Prasad
New User
Joined: 10 Mar 2006 Posts: 6 Location: Hyderabad
|
|
|
|
My dear friend,
In the send map para, i think no need to move low-values to the map
as it is been sending for the first time. |
|
Back to top |
|
|
pasupuleti
New User
Joined: 30 Jun 2006 Posts: 8 Location: India
|
|
|
|
Hi,
Refe to the paragraph :
SEND-DATA-MAP.
EXEC CICS SEND
FROM(WS-DATA)
ERASE
END-EXEC.
You're not using the map name, map set name. This could be causing the junk data to display. |
|
Back to top |
|
|
Hanfur
Active User
Joined: 21 Jun 2006 Posts: 104
|
|
|
|
Bhav,
Its a good practise toa lways intialises the variables in map before senting especially psuedo progs..
ovreddy,
R u trying to use the CICS SEND TEXT command ? If so there is no need to have a neither map set name nor map name.
-Han. |
|
Back to top |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi,
I used all the ways suggested by you. Still I am getting junk values only. I tried to debug the program line by line and I observed that RECEIVE command is not populating the values into Input variables. Is there any error in RECEIVE command or in MAP.
Bye,
Reddy. |
|
Back to top |
|
|
nallapureddy
New User
Joined: 27 Jul 2005 Posts: 18
|
|
|
|
Try to set MDT to the variables before sending..................... |
|
Back to top |
|
|
venu_dr
New User
Joined: 06 Jul 2006 Posts: 6
|
|
|
|
Hi,
Please try with this, you can get correct values.
EXEC CICS SEND
FROM(WS-DATA)
LENGTH(LENGTH OF WS-DATA)
ERASE
END-EXEC.
and also
EXEC CICS RETURN
TRANSID('TN23')
COMMAREA(VAL) - here instead of the VAL, you should use WS-COMM
LENGTH(4)
END-EXEC.
Always use LENGTH OF WS-COMM instead of giving the number in length. |
|
Back to top |
|
|
|