Problem COBOL - CICS Program does not change the Cursor



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Problem COBOL - CICS Program does not change the Cursor

Postby rogerb » Fri Aug 03, 2018 11:11 pm

Good afternoon.
First of all, I don't know if I'm placing this question in the right place, and if I'm not I apologize.
I've been working on a COBOL CICS Program to READ/WRITE in a VSAM ESDS.
I had some problems with the read but with the help of good people in this forum they were solved.
Today, I tested the Write operation and it also works well.

STATUS:  COMMAND EXECUTION COMPLETE                                          
EXEC CICS WRITE FILE
 FILE ('CARSDD  ')
 FROM ('22-10-2016EOPEL      ACORSA      25-33-XQ  MARCUS W          0  '...)
 LENGTH (200)
 RIDFLD (200)
 RBA

OFFSET:X'00116C'    LINE:00224          EIBFN=X'0604'                        
RESPONSE: NORMAL                        EIBRESP=0                            
                                                                             
ENTER:  CONTINUE                                                              


But now I have another problem.
In the BMS Basic Map Support I define the IC in the OPT field.

OPT     DFHMDF POS=(3,10),INITIAL='  ',                                X
               LENGTH=18,ATTRB=(UNPROT,IC),HILIGHT=UNDERLINE
        DFHMDF POS=(3,29),INITIAL=' ',                                 X
               LENGTH=1,ATTRB=ASKIP


But in the COBOL program, I change the positioning of the cursor to the INFO field with:

MOVE -1 TO INFOL.


When I do the debug of the program in the CICS with CEDF after I do "SEND MAP" it shows the MAP with the cursor in the same OPT field.

I don't know what I'm doing wrong and I need your help.

Thank you,
Roger
rogerb
 
Posts: 65
Joined: Sat Jul 28, 2018 9:14 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Problem COBOL - CICS Program does not change the Cursor

Postby NicC » Sat Aug 04, 2018 2:35 am

Show us the relevant bit of COBOL code that moves the cursor and sends the map.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Problem COBOL - CICS Program does not change the Cursor

Postby Robert Sample » Sat Aug 04, 2018 4:13 am

From https://www.ibm.com/support/knowledgece ... hp326.html
Positioning the cursor is important when you use a map for input. Usually, you set the initial position for the cursor in the map definition by including “insert cursor” (IC) in the ATTRB values of the field where you want it.

The CURSOR option on the SEND MAP command allows you to override this specification, if necessary, when the map is displayed. If you specify CURSOR(value), BMS places the cursor in that absolute position on the screen. Counting starts in the first row and column (the zero position), and proceeds across the rows. Thus, to place the cursor in the fourth column of the third row of an 80-column display, you code CURSOR(163).

Specifying CURSOR without a value signals BMS that you want “symbolic cursor positioning”. You do this by setting the length subfield of the field where you want the cursor to minus one (-1). Length subfields are not defined on output-only maps, so you must define your map as INOUT to use symbolic cursor positioning. (We tell you about length subfields in Formatted screen input, and about INOUT maps in Receiving mapped data.) If you mark more than one field in this way, BMS uses the first one it finds.

Symbolic cursor positioning is particularly useful for input-output maps when the terminal operator enters incorrect data. If you validate the fields, setting the length of any in error to -1, BMS places the cursor under the first error when you redisplay. Processing the mapped input shows this technique.
I did not check to see if you defined the map as INOUT; if not, moving -1 to the length will not work. However, since you did not specify CURSOR on your SEND MAP command, you will get the cursor at its default position (since you specified IC, you get it at that field).

These users thanked the author Robert Sample for the post:
rogerb (Sun Aug 05, 2018 1:59 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Problem COBOL - CICS Program does not change the Cursor

Postby rogerb » Sat Aug 04, 2018 4:15 am

Good evening.
This is the code of that part of the COBOL program.


050-ADD-RECORD.                                                  01770099
017800     MOVE LOW-VALUES TO CARMAI, CARMAO.                           01780099
017900       MOVE WS-NAMEDAY TO WS-MESSAGE (1:10).                      01790099
018000       MOVE ',  ' TO WS-MESSAGE (11:3).                           01800099
018100       MOVE WS-DATE TO WS-MESSAGE (14:10).                        01810099
018200       MOVE WS-MESSAGE TO CDAYO.                                  01820099
018210       MOVE CAR-COUNT TO CARNO.                                   01821099
019600     MOVE LOW-VALUES TO CARMAI, CARMAO.                           01960099
019610     MOVE -1 TO INFOL.                                            01961099
019700     MOVE "WRITE THE DATE OF SALE (DD-MM-YYYY) IN DATA" TO MSGO.  01970099
019800     PERFORM 030-SEND-MAP.                                        01980099
019900     PERFORM 040-RECEIVE-MAP.                                     01990099
020000     MOVE INFOI TO DATESOLD.                                      02000099
020100     MOVE LOW-VALUES TO CARMAI, CARMAO.                           02010099
020200     MOVE "WRITE THE CAR BRAND IN THE DATA FIELD" TO MSGO.        02020099
020300     PERFORM 030-SEND-MAP.                                        02030099
020400     PERFORM 040-RECEIVE-MAP.                                     02040099
020500     MOVE INFOI TO CARBRAND.                                      02050099


And this is the code for SEND MAP and RECEIVE MAP.

030-SEND-MAP.                                                    01670099
016800     EXEC CICS                                                    01680099
016900       SEND MAP('CARMA') MAPSET('CARMAP')                         01690099
017000       ERASE                                                      01700099
017100     END-EXEC.                                                    01710099
017200 040-RECEIVE-MAP.                                                 01720099
017300     EXEC CICS                                                    01730099
017400       RECEIVE MAP('CARMA') MAPSET('CARMAP')                      01740099
017500       ASIS                                                       01750099
017600     END-EXEC.                                                    01760099


Thank you,
Roger
rogerb
 
Posts: 65
Joined: Sat Jul 28, 2018 9:14 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Problem COBOL - CICS Program does not change the Cursor

Postby rogerb » Sun Aug 05, 2018 1:11 am

Good afternoon.

The map is defined as INOUT.

CARMAP  DFHMSD TYPE=&SYSPARM,LANG=COBOL,TERM=3270,MODE=INOUT,          X
               TIOAPFX=YES,CTRL=FREEKB,STORAGE=AUTO,EXTATT=YES


The SEND MAP was not defined using cursor.

I added CURSOR and I will try it.

Thank you,

Roger
rogerb
 
Posts: 65
Joined: Sat Jul 28, 2018 9:14 pm
Has thanked: 5 times
Been thanked: 0 time

Re: Problem COBOL - CICS Program does not change the Cursor

Postby rogerb » Sun Aug 05, 2018 1:59 am

Hello everybody.

My problem was that I was not using CURSOR in the SEND MAP.

I added CURSOR and now the problem is solved.

Thank you,

Roger
rogerb
 
Posts: 65
Joined: Sat Jul 28, 2018 9:14 pm
Has thanked: 5 times
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post