View previous topic :: View next topic |
Author |
Message |
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Fri Dec 01, 2006 7:01 am Post subject: Receive map with mapname in a variable name |
|
|
Hi,
Just would like to know if it is possible to execute the following command with a variable name in it
EXEC CICS RECEIVE
MAP (WS-CURRENT-MAP)
MAPSET (WS-CURRENT-MAP)
END-EXEC.
I am getting a pre-compiler error when I am using ws-current-map variable name.
'UNABLE TO APPLY DEFAULT FOR KEYWORD 'INTO'. '
Thanks
JA |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Dec 01, 2006 8:14 am Post subject: |
|
|
here is the answer to the pre-compiler error:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DFHP4A04/1.174?DT=20050113150738
essentially: you are not using the INTO or SET options, so the pre-compiler is attempting to resolve the receiving area as the map I<value of dataarea containing the mapname -WS-CURRENT-MAP>:
Quote: | INTO(data-area)
specifies the data area into which the mapped data is to be written. If this field is not specified, the name defaults to the name of the map suffixed with an I. |
Quote: | "name" can be replaced by either of the following:
* A character string in single quotation marks (that is, a nonnumeric literal). If this is shorter than the required length, it is padded with blanks.
* A COBOL data area with a length equal to the required length for the name. The value in "data-area" is the name to be used by the argument. If "data-area" is shorter than the required length, the excess characters are undefined, which might lead to unpredictable results. |
So, have you defined WS-CURRENT-MAP in WORKING-STORAGE? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Dec 01, 2006 9:08 am Post subject: |
|
|
I believe that you must supply either the INTO or SETPTR options, with a field.
I am not going to guess what you are doing, but when I set up systems that had only one front-end SEND or RECEIVE module, in which none of the MAPs where declared, the MAP and MAPSET names where contained in variables and there was a common area for the INTO or a POINTER was set. The variables containing the MAP/MAPSET names and the common area or POINTER were all in linkage. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Fri Dec 01, 2006 9:33 am Post subject: |
|
|
Yes I have defined it in my working storage section as given below.
05 WS-CURRENT-MAP PIC X(07) VALUE 'DNPMA1'.
The purpose of this code is to make this receive map command a generic one. I placed this command in a copy book and want to use it in multiple programs. Each program will have different map name. So in this case, i was expecting the the program to execute as if I coded it below.
EXEC CICS RECEIVE
MAP ('DNPMA1')
MAPSET ('DNPMA1')
END-EXEC.
Any idea how to make it work?
Thanks
JA |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Fri Dec 01, 2006 10:15 am Post subject: |
|
|
Hey...Thanks many...that one is working. cool.
Thanks a million
JA |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Fri Dec 01, 2006 11:39 am Post subject: |
|
|
Sorry, Me again. My compilation was ok, but now during execution, i am getting APCT.
Following is the XPEDITOR display. This map is defined and I was using it before this code change. But when i changed the map name to a variable name, it is giving me APCT.
LV ----- COBOL DATANAME KEEPS ---- -- ATTRIBUTES -- ----+---10----+---20--
02 WS-CURRENT-MAP X(06) DNPM41
02 WS-CURRENT-MAP-INPUT X(07) DNPM41I
01 DFHB0020 S9(4) COMP +0007
---------------------APCT (MODULE NOT FOUND IN PPT) at DNP410.1711 ->
*EXEC CICS SEND
* MAP (WS-CURRENT-MAP)
* FROM (WS-CURRENT-MAP-INPUT)
* MAPSET (WS-CURRENT-MAP)
* FREEKB
* CURSOR
* ERASE
* FRSET
*END-EXEC
Move length of WS-CURRENT-MAP-INPUT to dfhb0020
Move -1 to dfhb0021
Call 'DFHEI1' using by content x'1804f1000700c300001de2
- '04000020f0f1f6f2f5404040' by reference WS-CURRENT-MAP by
reference WS-CURRENT-MAP-INPUT by reference dfhb0020 by
reference WS-CURRENT-MAP by content x'0000' by content x'0000
- '' by content x'0000' by reference dfhb0021 end-call
Could any one help please?
Thanks
JA |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Fri Dec 01, 2006 11:41 am Post subject: |
|
|
Jamylady,
Looks like your Contents for WS-CURRENT-MAP-INPUT & WS-CURRENT-MAP are overlaid. Make sure you move the contents just before the send command
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Fri Dec 01, 2006 11:47 am Post subject: |
|
|
Kolusu,
I have declared these variables in the working storage section as given below.
05 WS-CURRENT-MAP-INPUT PIC X(07) VALUE 'DNPM41I'.
05 WS-CURRENT-MAP PIC X(06) VALUE 'DNPM41'.
Would it any way casue an over lay?
Thanks
JA |
|
Back to top |
|
|
semigeezer Supermod
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
|
Posted: Fri Dec 01, 2006 12:13 pm Post subject: |
|
|
You'll need to go back and read up on how maps are defined. When you compile a map and you get a cobol copybook from it which is included in your source. That is the data which you need to define in your program. You can set up your program so that multiple maps use the same storage by using set address instructions (sorry, it has been a long time since I looked at COBOL), but the amount of storage must be enough to hold the largest map. |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Fri Dec 01, 2006 4:40 pm Post subject: |
|
|
actually, only need to look at the syntax.
Quote: | EXEC CICS SEND
* MAP (WS-CURRENT-MAP) - name
* FROM (WS-CURRENT-MAP-INPUT) - data area
* MAPSET (WS-CURRENT-MAP) - name |
names can be a variable; in this case they contain the name of the MAP &/or MAPSET which is used at RUN-TIME to pull the map from the CICS Tables for use during the service call - receive or send.
the FROM (and INTO for receive) fields are data areas; which is a physical place in memory where CICS gets or puts the data returned from the service call. data names can not be variables. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Mon Dec 04, 2006 9:46 am Post subject: |
|
|
So you mean to say that we can use varible in MAP, we should use the exact map inpur area in the FROM /INTO feilds? IIf it is so, I think I cant make it generic.
Also I have one map per mapset.
So i tried with copy with replacing option. But the weired result is that PRECOMPILER do not allow a COPY with REPLACE option in it if it contain a CICS command.! If I dont have any CICS command, COPY with REPLACE command is working fine and this copy book is being copied in to the program. But if I can CICS command in this copy, book, then PRECOMPILER fails to copy this copy book. It gets copied during the COBOL compilation and cobol compiler showing me error on CICS commands.!!
Any solutions?
Thanks
JA |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Dec 04, 2006 11:22 am Post subject: |
|
|
The MAP and MAPSET parameters require either literals or variables (containing a value equal to a map or mapset name). The value of the parms (literal or value containing variable) is used by CICS to extract the CICS tabled definition of the map/mapset. The INTO or FROM option combined with a (field) is the reference of a data are containing the actual map data - the field parm to the INTO/FROM option must be the reference of a area either containing map/mapset data to be sent, or the area that will receive the map data - it can not be a variable containing the reference name of an area, or an address.
If you need to redefine this area with map/mapset definitions (copybooks), declare them in the LINKAGE SECTION and ORIGIN your map to the data area of the INTO/FROM parm.
Code: |
SET ADDRESS OF MAP347
MAP347I
TO GENERIC-INTO-FROM-AREA |
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Mon Dec 04, 2006 1:28 pm Post subject: |
|
|
That is good. But I afraid it requires additional coding to move data from Linkage section and to Linkage section. Please correct me if I am worong here.
Thanks
JA |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Dec 04, 2006 8:00 pm Post subject: |
|
|
Don't understand your problem. There is no need to move data from & from LINKAGE SECTION.
Since the CICS RECEIVE or SEND code is in a copybook, any module including the copybook must have the SAME 3 data areas defined:- A - variable containing the MAP name
- B - variable containing the MAPSET name
- C - area of sufficient size to contain a map - any map
The reference names of A & B will be the parms for the MAP and MAPSET option, respectively. The reference name of C will be field for the INTO or FROM option.
As long as C is properly defined and has addressability (Such as an area defined in working storage), you can declare you maps in linkage and by use of the SET command (again, each module would require this modification in addition to adding the COPY command and loading the variables with the right map name), redefine the common input/from data area with the map of that module. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
Jamylady Beginner
Joined: 04 Nov 2004 Posts: 68 Topics: 22
|
Posted: Tue Dec 05, 2006 5:58 am Post subject: |
|
|
I followed the following steps. Not sure I am doing the right thing.
Declared a pointer in working stroage
77 WS-MAP-ADDRESS USAGE IS POINTER.
Decalread the MAP in the Linkage section. (Copy DNPM41)
Then in Procedure divinsion, i set the address as follows.
SET ADDRESS OF DNPM41 TO WS-MAP-ADDRESS.
But now even before I get to execute any CICS command, I am getting an ASRA because I was trying to move a value to a map filed (DATEO) which is actually a linkage section variable. Am i doing some thing stupid here?
Thanks
JA |
|
Back to top |
|
|
|
|