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

Help in simple CICS program.........


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Thu Jul 06, 2006 4:25 pm
Reply with quote

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
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Thu Jul 06, 2006 4:50 pm
Reply with quote

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
View user's profile Send private message
M.Bhavani Prasad

New User


Joined: 10 Mar 2006
Posts: 6
Location: Hyderabad

PostPosted: Thu Jul 06, 2006 4:59 pm
Reply with quote

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
View user's profile Send private message
pasupuleti

New User


Joined: 30 Jun 2006
Posts: 8
Location: India

PostPosted: Thu Jul 06, 2006 5:47 pm
Reply with quote

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
View user's profile Send private message
Hanfur

Active User


Joined: 21 Jun 2006
Posts: 104

PostPosted: Fri Jul 07, 2006 10:01 am
Reply with quote

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
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Fri Jul 07, 2006 1:20 pm
Reply with quote

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
View user's profile Send private message
nallapureddy

New User


Joined: 27 Jul 2005
Posts: 18

PostPosted: Fri Jul 07, 2006 1:55 pm
Reply with quote

Try to set MDT to the variables before sending.....................
Back to top
View user's profile Send private message
venu_dr

New User


Joined: 06 Jul 2006
Posts: 6

PostPosted: Fri Jul 07, 2006 6:51 pm
Reply with quote

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
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts DB2 Event passed to the Application P... DB2 1
Search our Forums:

Back to Top