Hi ,
Please find my below requirement and the issue faced during coding my requirement.
Requirement : Read KSDS file, move the first occurence of ROLL-NUMBER field (RTR:-ROLL-NUMBER PIC S9(02) PACKED-DECIMAL) to
SERIAL-NUMBER field (MCMM-SERIAL-NUMBER PIC S9(02) COMP-3) in Mini file, both files are already present in the system.
Issue :
1) When i directly code the below move statment, job abends with SOC7. And when i XPED the code, RTR-ROLL-NUMBER is filled with question marks ?? (Packed Decimal)
MOVE RTR-ROLL-NUMBER (1) TO MCMM-SERIAL-NUMBER
2) Later i tried to evaluate the RTR-ROLL-NUMBER filed, now for all records IF condition doesnt get satisfied and the control goes to the ELSE part (all MCMM-SERIAL-NUMBER were filled with ZEROES.)
IF RTR-MARKET-TYPE(1) IS NUMERIC
MOVE RTR-ROLL-NUMBER (1) TO MCMM-SERIAL-NUMBER
ELSE
MOVE ZEROES TO MCMM-SERIAL-NUMBER
END-IF
3) I tried moving the PAcked decimal to a working storage variable (PIC S9(02) VALE ZEROES), again job abended with SOC7
MOVE RTR-ROLL-NUMBER (1) TO WS-MCMM-SERIAL-NUMBER
4) I have checked the Packed decimal values present in the input file, and all values are NUmeric and valid. (Viewed it through File aid along with Input Files copy book)
Questions :
1) Cant we directly move a PACKED DECIMAL value to COMP-3 field (As both are same).
2) Please let me know the corrections which i need to incorporate in my process or If i have entirely change the approach.
Your help is higly appreciated