Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*-------------------------------------
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(80).
05 WS-IN-PART2 PIC X(13).
*-------------------------------------
* OUTFILE RECORD LAYOUT
*-------------------------------------
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(80).
05 WS-OUT-PART2 PIC --,---,---.99.
*---------------------------------------------
2000-MAIN-PROCESS.
DISPLAY "IN" WS-IN-PART2
COMPUTE WS-OUT-PART2 = FUNCTION NUMVAL (WS-IN-PART2)
DISPLAY WS-IN-PART2
2000-MAIN-PROCESS-EXIT.
EXIT.
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
BEGIN PROGRAM
IN 661.95
OUT 661.95
IN 34,214.40
IGZ0152S Invalid character , was found in column 7 in argument-1 for function NUMVAL in program FAMR0020 at
displacement X'06C8'.
From compile unit PROGRAM at entry point FAMR0020 at compile unit offset +000006C8 at address 0A600C28.
<> LEAID ENTERED (LEVEL 07/09/2002 AT 11.37)
<> LEAID ENTERED (LEVEL 07/09/2002 AT 11.37)
<> LEAID ABENDAID DD ALLOCATED BY #XAMAKDD DYNALLOC RC =00000
CEE3DMP V2 R10.0: Condition processing resulted in the unhandled condition.
*-------------------------------------
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(80).
05 WS-IN-PART2 PIC X(13).
*-------------------------------------
* OUTFILE RECORD LAYOUT
*-------------------------------------
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(80).
05 WS-OUT-PART2 PIC --,---,---.99.
01 WS-OUT-PART-N PIC S9(13)V99.
*---------------------------------------------
2000-MAIN-PROCESS.
DISPLAY "IN" WS-IN-PART2
COMPUTE WS-OUT-PART-N = FUNCTION NUMVAL-C (WS-IN-PART2)
MOVE WS-OUT-PART-N TO WS-OUT-PART2
DISPLAY WS-IN-PART2
2000-MAIN-PROCESS-EXIT.
EXIT.
1234567
"IN 34,214.40
IN 7,501.02
OUT 7,501.02
IN 260,312.72-
OUT -260,312.72
IN 119,183.55-
OUT -119,183.55
IN 7,501.02-
OUT -7,501.02
000001 IDENTIFICATION DIVISION.
000002 PROGRAM-ID. NUMSPL.
000003 ENVIRONMENT DIVISION.
000007 DATA DIVISION.
000008 WORKING-STORAGE SECTION.
000009 01 I PIC S9(5) COMP-3 VALUE 0.
000010 01 J PIC 9(4) COMP-6 VALUE 0.
000011 01 K PIC 9(4) COMP-6 VALUE 0.
000012 01 N1 PIC 9(13).
000013 01 N1-X REDEFINES N1.
000014 02 VEC-N1 PIC X OCCURS 13.
000015 01 N2 PIC V9(5).
000016 01 N2-X REDEFINES N2.
000017 02 VEC-N2 PIC X OCCURS 5.
000018 01 X PIC X(20) JUST RIGHT.
000019 01 X-R REDEFINES X.
000020 02 VEC-X PIC X OCCURS 20.
000021 01 SW-PERIOD PIC 9.
000022 01 SW-SIGN PIC 9.
000023**********************
000024 LINKAGE SECTION.
000025 01 INP PIC X(20) JUST RIGHT.
000026 01 N PIC S9(12)V9(5) COMP-3.
000027********************************************************
000028 PROCEDURE DIVISION USING INP N.
000029 MAIN SECTION.
000030 1. MOVE INP TO X.
000031 PERFORM IN-NUM.
000032 EXIT PROGRAM.
000033 IN-NUM.
000034 IF VEC-X(20) = SPACE MOVE "," TO VEC-X(20).
000035 INSPECT X REPLACING ALL SPACE BY ZERO.
000036 MOVE 0 TO N1 N2.
000037 MOVE 0 TO K SW-PERIOD SW-SIGN.
000038 PERFORM IN-NUM1 VARYING I FROM 1 BY 1 UNTIL I > 20.
000039 IF SW-PERIOD > 0 SUBTRACT 1 FROM K
000040 ELSE MOVE 20 TO K.
000041 MOVE 14 TO J.
000042 PERFORM IN-NUM2
000043 VARYING I FROM K BY -1 UNTIL (J = 1 OR I < 1).
000044 IF SW-PERIOD > 0 ADD 2 TO K
000045 MOVE 0 TO J
000046 PERFORM IN-NUM3
000047 VARYING I FROM K BY 1 UNTIL (J = 5 OR I > 20).
000048 ADD N1 N2 GIVING N.
000049 IF SW-SIGN = 1 MULTIPLY -1 BY N.
000050 IN-NUM1.
000051 IF VEC-X(I) = "." MOVE I TO K
000052 MOVE 77 TO I
000053 MOVE 1 TO SW-PERIOD.
000054 IN-NUM2.
000055 IF VEC-X(I) = "-" MOVE 1 TO SW-SIGN
000056 ELSE IF VEC-X(I) NOT = "," SUBTRACT 1 FROM J
000057 MOVE VEC-X(I) TO VEC-N1(J).
000058 IN-NUM3.
000059 IF VEC-X(I) = "-" MOVE 1 TO SW-SIGN
000060 ELSE IF VEC-X(I) NOT = "," ADD 1 TO J
000061 MOVE VEC-X(I) TO VEC-N2(J).
000062 EX-IN-NUM.