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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: Help in simple CICS program.........
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    Post subject: Hi
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    Post subject: Re: Help in simple CICS program.........
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    Post subject: Help in simple CICS program.........
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    Post subject: Hi
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing a file using online program grvtomar PL/I & Assembler 3 Fri Jun 30, 2017 1:06 pm
No new posts How to Clear all TSQs during CICS sta... Hooman24 CICS 10 Mon Jun 26, 2017 9:46 pm
No new posts pre-compiler for program in an HFS Pedro DB2 0 Fri Jun 23, 2017 11:13 pm
No new posts CICS Transaction attach count of supp... lind sh CICS 1 Wed Jun 21, 2017 1:33 pm
No new posts Compiling program in endeavor for tra... RALAKKAL Compuware & Other Tools 4 Mon Jun 05, 2017 8:27 pm


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