Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help needed fixing error

Status
Not open for further replies.

rpt860

MIS
Nov 5, 2010
3
US
IDENTIFICATION DIVISION.
PROGRAM-ID. MIS210-2.


WORKING-STORAGE SECTION.
01 CO-NAME PIC X(25).
01 Q1US PIC ZZZZZZZZVZZ.
01 Q2US PIC ZZZZZZZVZZ.
01 USP PIC ZZZZZZVZZ.
01 BUDGETED-SALES1 PIC ZZZZZZZ.ZZ.
01 BUDGETED-SALES2 PIC ZZZZZZZ.ZZ.
01 DEI-1 PIC 99999.
01 DEI-2 PIC 99999.
01 TOTAL-NEEDS PIC 999999.
01 END-INV-1 PIC 99999.
01 END-INV-2 PIC 99999.
01 UNITS-T2-PRODUCED PIC 999999.
01 DIRECT-LBR-HOURS PIC 9999V99.
01 VAR-OH-RATE PIC $$$$9.99.
01 BUDGT-VAR-OH-RATE PIC $$$$9.99.
01 BUDGT-FIX-OH PIC 9999.
01 BUDGET-SELECTION PIC 9.


PROCEDURE DIVISION.

DISPLAY 'Welcome! This program will be able to generate 3'
DISPLAY 'different budgets for you. The sales budget,'
DISPLAY 'production budget, overhead budget.'
DISPLAY ' '
DISPLAY 'First, we will need some information'
DISPLAY ' '
DISPLAY 'What is your company name?'
ACCEPT CO-NAME.
INSPECT CO-NAME CONVERTING
'abcdefghijklmnopqrstuvwxyz' TO 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.
DISPLAY 'What are you sales in units for quarter 1?'
ACCEPT Q1US
DISPLAY 'What are you sales in units for quarter 2?'
ACCEPT Q2US
DISPLAY 'What is the unit selling price?'
ACCEPT USP
DISPLAY 'What is your desired ending inventory for quarter 1?'
ACCEPT DEI-1
DISPLAY 'What is your desired ending inventory for quarter 2?'
ACCEPT DEI-2
DISPLAY 'What was your ending inventory for quater 1?'
ACCEPT END-INV-1
DISPLAY 'What was your ending inventory for quater 2?'
ACCEPT END-INV-2
DISPLAY 'What is the budgeted direct labor hours?'
ACCEPT DIRECT-LBR-HOURS
DISPLAY 'What is your variable overhead rate?'
ACCEPT VAR-OH-RATE

MULTIPLY Q1US BY USP GIVING BUDGETED-SALES1

DISPLAY ' '
DISPLAY ' '
DISPLAY '*****************************************************'
DISPLAY '* 1. Sales Budget *'
Display '* 2. Production Budget *'
Display '* 3. Overhead Budget *'
DISPLAY '*****************************************************'
DISPLAY ' '
DISPLAY ' '
DISPLAY 'Which budget would you like to generate?'
ACCEPT BUDGET-SELECTION
DISPLAY ' '

IF BUDGET-SELECTION = 1
DISPLAY ' 'CO-NAME
DISPLAY ' SALES BUDGET. '
DISPLAY ' '
DISPLAY ' QUARTER'
DISPLAY ' 1 2'
DISPLAY 'UNITS 'Q1US' 'Q2US
DISPLAY 'SELLING PRICE ' USP ' ' USP
DISPLAY 'BUDGETED SALES'
END-IF


I get an error on this line..
MULTIPLY Q1US BY USP GIVING BUDGETED-SALES1

I do not see what im doing wrong. if anyone can help i would be very grateful :D
 
Q1US and USP are numeric EDITED, so you can't multiply them.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
does that mean i have to define them as 9999.99 for example?
 
yes, and move or redefine the fields and use those to multiply
 
You cannot use 9999.99 as the PIC. That is still an edited numeric field with a decimal point. You need an implied decimal point such as 9999V99. You cannot use a REDEFINES and expect it to work correctly all the time. If you have a field defined as ZZZZVZZ and you move a numeric value to that field, it may contain spaces (which are not numeric) into some of the leading positions. Redefining it does not change the data that is there. So if you tried to use a redefinition as 9999V99 you may get a data exception (S0C7) at execution time.
 
At first glance, I think the problem is that Q1US and USP having editing masks on them and are not simply 999999v99.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top