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.
*----------------------------------
* INFILE RECORD LAYOUT
*---------------------------------
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(69).
05 WS-IN-PART2 PIC 999999V99.
*-----------------------------------------------------------
* OUTFILE RECORD LAYOUT
*-----------------------------------
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(69).
05 WS-OUT-PART2 PIC ---,---,---,---.99.
*------------------------------
MOVE WS-IN-PART1 TO WS-OUT-PART1
MOVE WS-IN-PART2 TO WS-OUT-PART2
WRITE OUTREC FROM WS-OUTFILE-RECORD
*----------------------------------------------------------------*
* INFILE RECORD LAYOUT *
*----------------------------------------------------------------*
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(79).
05 WS-IN-PART2 PIC S9(13)V99 SIGN TRAILING SEPARATE.
*----------------------------------------------------------------*
* OUTFILE RECORD LAYOUT *
*----------------------------------------------------------------*
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(79).
05 WS-OUT-PART2 PIC -9(13)V99.
*----------------------------------------------------------------*
An operation was attempted on data defined with a separate sign. The
value in the sign position was not a plus (+) or a minus (-).
The error might have been caused by a REDEFINES clause involving the
sign position or a group move involving the sign position, or the
position was never initialized.
IDENTIFICATION DIVISION.
PROGRAM-ID. testing.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 v1 pic S9(9)V99 VALUE -1234.56.
01 v2 pic 9(9)V99 VALUE 1234.56.
01 v3 pic -(10).99.
01 v4 pic ----,---,---.--.
01 v5 pic S9(9)V99 VALUE -1234.56 SIGN LEADING SEPARATE.
01 v6 pic S9(9)V99 VALUE 1234.56 SIGN LEADING SEPARATE.
01 v7 pic S9(9)V99 VALUE -1234.56 SIGN TRAILING SEPARATE.
01 v8 pic S9(9)V99 VALUE 1234.56 SIGN TRAILING SEPARATE.
PROCEDURE DIVISION.
M1. MOVE V1 TO v3 V4.
DISPLAY "V3=" V3 "== V4=" V4 "==".
MOVE V2 TO v3 V4.
DISPLAY "V3=" V3 "== V4=" V4 "==".
DISPLAY "V5=" V5 "==".
DISPLAY "V6=" V6 "==".
DISPLAY "V7=" V7 "==".
DISPLAY "V8=" V8 "==".
accept v1.
181,666.18-
FFF6FFF4FF6
181,666.18
FFF6FFF4FF
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(80).
05 WS-IN-PART2 PIC 999,999.99-.
*-------------------------------------------------------*
* OUTFILE RECORD *
*-------------------------------------------------------*
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(80).
05 WS-OUT-PART2 PIC ----,---.99.
IF WS-IN-PART2 < 0
MOVE WS-IN-PART2(1:11) TO WS-OUT-PART2
ELSE
MOVE WS-IN-PART2(1:10) TO WS-OUT-PART2
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
BEGIN FAMR0013
JAY
661.
661.
661.00
JAY
34,214.
34,214.
CEE3207S The system detected a data exception (System Completion Code=0C7).
From compile unit FAMR0011 at entry point FAMR0011 at compile unit offs MR0011 at compile unit offset +0000063A at address 0A600BFA.
<> LEAID ENTERED (LEVEL 07/09/2002 AT 11.37)
<> LEAID ABENDAID DD ALLOCATED BY #XAMAKDD DYNALLOC RC =00000
<> LEAID PROCESSING COMPLETE.
*******************************************
* Analysis of Error *
*******************************************
A Data Exception was caused by data referenced at displacement 09C from
the start of TGT BLW cell 00 (X'0'). The field contains
X'F3F46BF2F1F4'. Refer to the data division map in the program listing
to locate the field name.
The field causing the exception is located in a temporary work field in
the DSA. The actual field in error is in Working-Storage of program
A Data Exception is caused when a computational-3 field has
an invalid digit (not 0-9), or its last byte contains an invalid
sign (not A, B, C, D, E, or F).
200406 661.95
444444444FFFFFF4444444444444444444FFF4FF
0000000002004060000000000000000000661B95
---------------------------------------
200403 34,214.40
444444444FFFFFF4444444444444444FF6FFF4FF
IDENTIFICATION DIVISION.
PROGRAM-ID. DEMO.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-IN-PART2 PIC X(11).
01 REDEFINES WS-IN-PART2.
10 WS-IN-PART3 PIC X(10).
10 PIC X(1).
01 WS-OUT-PART-N PIC S9(8)V99.
01 WS-OUT-PART2 PIC ----,---.99.
PROCEDURE DIVISION.
MAIN1.
MOVE " 34,214.40-" TO WS-IN-PART2
DISPLAY "==" 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-OUT-PART2 "==".
01 WS-INFILE-RECORD.
05 WS-IN-PART1 PIC X(80).
05 WS-IN-PART2 PIC X(11).
*-------------------------------------------------------*
* OUTFILE RECORD *
*-------------------------------------------------------*
01 WS-OUTFILE-RECORD.
05 WS-OUT-PART1 PIC X(80).
05 WS-OUT-PART2 PIC ----,---.99.
...
Compute WS-Out-Part2 = Function NumVal (WS-IN-Part2)
IDENTIFICATION DIVISION.
PROGRAM-ID. test1.
DATA DIVISION.
WORKING-STORAGE SECTION.
05 WS-IN-PART2 PIC X(11) VALUE "123".
05 WS-OUT-PART2 PIC ----,---.99.
PROCEDURE DIVISION.
0000-start.
Compute WS-Out-Part2 = Function NumVal (WS-IN-Part2)
DISPLAY WS-Out-Part2
MOVE Function NumVal (WS-IN-Part2) TO WS-Out-Part2
DISPLAY WS-Out-Part2
STOP RUN.