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

Using a variable in Receive Map


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

New User


Joined: 08 Oct 2007
Posts: 3
Location: India

PostPosted: Wed Jul 07, 2010 6:53 pm
Reply with quote

Hi,
I have a set of 9 screens/maps in a application which can be traversed by pressing the function keys F1 to F9 resp. I can traverse from any screen to any screen. On pressing a function key I have to receive the previous screen's value and have to throw the current screen(corresponding to function key).

Qsn:
On pressing a function key say F7, I have to receive the data from the previous screen. This previous screen can be any of the 9 screens. I would like to write the recieve using a variable name which already holds the map name.

Map name: MAP1, MAP2... MAP9
Variable: WS-MAP-NAME

EXEC CICS RECEIVE
MAP (WS-MAP-NAME)
END-EXEC.

On compilation I'm facing a problem that 'UNABLE TO APPLY DEFAULT FOR KEYWORD 'INTO'.'


Can we use variables inside EXEC CICS commands? Is there a better way(other than the evaluate & if) to accomplish this logic?
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Wed Jul 07, 2010 7:26 pm
Reply with quote

Quote:
Code:
EXEC CICS RECEIVE
MAP (WS-MAP-NAME)
END-EXEC.


And where are the contents of the map to be when you execute this command? You have to specify SET() or INTO() to specify where the received map is to be located. (The clue is in the compile error message).

There's nothing wrong with using a variable to specify the map name.

Garry.
Back to top
View user's profile Send private message
Jayaprakash Janarthanan

New User


Joined: 08 Oct 2007
Posts: 3
Location: India

PostPosted: Wed Jul 07, 2010 8:04 pm
Reply with quote

Thanks for the reply Garry!
The actual catch is in the 'INTO' part. The SDF has created the copybooks for each map and say for MAP1, the input group variable is MAP1I and the output group variable is MAP1O.

So, depending on the map I receive the INTO clause varies from MAP1I, MAP2I ... MAP9I... I don't know how to attach the dynamic <mapname> to static <I> and put it in the INTO clause.

I thought the system would assume the INTO part according to the map name. Any idea on how to achieve the <mapname>I part?

Any help would be much appreciated. Thanks!
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 8:12 pm
Reply with quote

how many modules are involved in this application?

is there a one-to-one map to module
or
does only one module do all the sending and receiving?
Back to top
View user's profile Send private message
Jayaprakash Janarthanan

New User


Joined: 08 Oct 2007
Posts: 3
Location: India

PostPosted: Wed Jul 07, 2010 10:59 pm
Reply with quote

Hi,
It's just a single program/module in the application.
The idea that I have in mind is to put this entire receive statement in a IF or EVALUATE and use them according to the maps I would like to receive. But for a list of 9 screens, that would reduce the readability and I wish to have a more effective method, something like dynamically populating the clauses MAP, MAPSET & INTO.

Map names: MAP1, MAP2... MAP9
Mapsets : MAP1, MAP2... MAP9
BMS cpy : MAP1I, MAP2I.... MAP9I
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Wed Jul 07, 2010 11:11 pm
Reply with quote

Nine screens icon_question.gif icon_question.gif icon_question.gif

You should have nine different programs.

Otherwise, you could very well be creating a maintenance monster. icon_eek.gif

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 11:19 pm
Reply with quote

other than the rather important comment that bill provided,
something to think about.

the module is rather large, impacts performance and cics memory

you apparently already have all the necessary code to populate/depopulate the 9 different screens - the -mapo's and -mapi's.

if they all were to redefine the same area, you would only need one send and one receive in the program.

the MAPNAME and the MAPSET are what are important- these values are used by CICS to access 'data' in cics tables/areas (maps)
SEND merges the data at the address provided by mapo with the MAP and then ships the whole stream to the terminal.
the receive uses the MAP to interpret the instream data to populate the address of the mapo.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 07, 2010 11:59 pm
Reply with quote

when you get feed-up with this maintenance nightmare,
you will find that splitting up the modules will be easy.

CONTROL pgm (also known as a distributor) knows the map name.
does a receive into an area, passes the area to that MAPs module via LINK,
module does its thing, returns to distributor.

distributor decides what next to do, LINK to module for that MAP,
module does its thing, passes back the populated MAPO,
distributor does a SEND,
saves what it needs to save to know where it is,was, did, must do next, etc..
and returns to cics.
Back to top
View user's profile Send private message
selvaganesan

New User


Joined: 21 Oct 2005
Posts: 5
Location: USA

PostPosted: Thu Jul 15, 2010 8:54 am
Reply with quote

Hi
In the above application program,suppose user enters data in screen1 and navigates to Screen2 and if user returns to screen1 than we need to display screen1 data again for editing.

Is there way to retain the data between navigation(Using CICS commands)?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Jul 15, 2010 9:13 am
Reply with quote

Quote:
Is there way to retain the data between navigation(Using CICS commands)?
This is why you use DFHCOMMAREA or TS queues (although there are other ways to do this).
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Jul 17, 2010 6:03 pm
Reply with quote

Quote:
throw the current screen


maybe its because I'm old dog, but this kind of terminology drives me
nuts!.

There is only a couple of times you every THROW anthing in CICS:

1. You THROW the listing of a monstrosity program in the trash.

2. You THROW the programmer out of your office that brought you
the listing, so you can fix his problems.

Otherwise, you DISPLAY.

icon_biggrin.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8700
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 17, 2010 6:09 pm
Reply with quote

Earl, it's the Java / C / .Net culture. The sad thing to me is that the o/p used the correct terminology in the same sentence (receiving the map) yet could not use "send" the map or "display" the map.
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 REXX/CMS How to place command console... CLIST & REXX 4
No new posts CA7 count with DATE variable CA Products 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
Search our Forums:

Back to Top