Operating System - HP-UX
1827696 Members
3136 Online
109967 Solutions
New Discussion

Microfoucus Cobol "accept" question

 
Renda Skandier
Frequent Advisor

Microfoucus Cobol "accept" question

We are trying to convert from rmcobol in NCR unix to microfocus cobol on a HP machine and are having issues with the accept command.

Compiling with the rm switch cause too many other problems.

I am accepting a pic x(6) field. If I enter 100, without preceding 0s, it displays 100000.
In rm it was 000100. I try writing a justify routine but that gets a bit hacky. When trying to overwrite that field, it still accepts starting in left most character. If the user is tring to change 100 to 110, the would be looking at 110100. The field may or may not have a decimal point, so I can't accept a pic 9 field.

Is there an easy command I'm just missing??
tia
5 REPLIES 5
Michael Schulte zur Sur
Honored Contributor

Re: Microfoucus Cobol "accept" question

Hi,

do you initialize the field with spaces? Is the field in rm right justified? Can you post the definition and accept?

greetings,

Michael
Renda Skandier
Frequent Advisor

Re: Microfoucus Cobol "accept" question

01 WS-DISP-FIELD PIC $$$$$$9.99-.
01 WS-DISP-OLD PIC ZZZZZ9.99-.

IF FOUND-ORIGINAL
MOVE I-TENDER-5 TO WS-DISP-OLD
ACCEPT WS-DISP-OLD LINE 13 COL 27
MOVE WS-DISP-OLD TO WS-DISP-FIELD,
I-TENDER-5
DISPLAY WS-DISP-FIELD LINE 13 COL 27
END-IF.


If my field is [ 213.00 ]
I enter 57
I end up with $573.00
If a decimal point is enterd, those values appear after decimal point fine.
If no decimal is entered, it is assumed and 00 are stored after the decimal


In RM, I performed a left shift for display
purposes only.
Michael Schulte zur Sur
Honored Contributor

Re: Microfoucus Cobol "accept" question

Hi,

I have tried this with our mf cobol on tru64 unix and it behaves the same way. To me it is logical. If you do not want to edit the old value then dont preset the accept field with it. After pressing ., it is clear that the first part ist done. Are the definitions of the fields for both compilers the same? Where do the leading zeroes come from in rm?

greetings,

Michael
Renda Skandier
Frequent Advisor

Re: Microfoucus Cobol "accept" question

hi michael,
this is a cashier balancing screen where the user may have to change 1 or 2 lines in 20. They must be able to see the current value.
this is an example of the screen:
REGISTER ACTUAL
TAPE COUNT
LOAN 100.00
CASH [ 212.00 ][ 989.00 ]
CHECKS [1400.00 ][8400.00 ]
PICKUPS [ 213.00- ][ 573.00 ]
A/R CHARGES [ 12.00 ][ 12.65 ]
CREDIT CARDS[ 212.00 ][ 212.00 ]
DEBIT CARDS [ 878.54 ][ 878.54 ]
FOOD STAMPS [ 0.00 ][ 0.00 ]


i'm guessing i must write a routine to be called after every accept. we contacted hp and their explanation is that microfocus is character driven.

thanks for your help,
renda
Michael Schulte zur Sur
Honored Contributor

Re: Microfoucus Cobol "accept" question

Hi,

you could show the old value in a separate field or the user must enter a . even if the rest is zero.

have fun,

Michael