I have a requirement where I want to move a date(DDMMYY) in numeric format into a packed decimal/ comp-3 of 3 bytes. the date have to be moved into an file where only 3 characters/bytes are allocated for it. This is what I tried.
03 WD-DDMMYY-DT-NUMERIC PIC 9(06).
03 WD-DDMMYY-DT-COMP3 PIC S9(06) COMP-3.
03 WD-DDMMYY-REDF REDEFINES WD-DDMMYY-DT-COMP3.
05 WD-3CHARS-DT-COMP3 PIC X(03).
05 FILLER PIC X(01).
Move WD-DDMMYY-DT-NUMERIC to WD-DDMMYY-DT-COMP3
Move WD-3CHARS-DT-COMP3 to file-variable --> X(03)
I am not getting the desired value in the output. how can it be done?
should solve your problem.