View previous topic :: View next topic
|
Author |
Message |
Jayaprakash Janarthanan
New User
Joined: 08 Oct 2007 Posts: 3 Location: India
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Jayaprakash Janarthanan
New User
Joined: 08 Oct 2007 Posts: 3 Location: India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
Jayaprakash Janarthanan
New User
Joined: 08 Oct 2007 Posts: 3 Location: India
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
Nine screens
You should have nine different programs.
Otherwise, you could very well be creating a maintenance monster.
Bill |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
selvaganesan
New User
Joined: 21 Oct 2005 Posts: 5 Location: USA
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Earl Haigh
Active User
Joined: 25 Jul 2006 Posts: 475
|
|
|
|
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.
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
|