Hi,
I want to convert numeric string ('12345 ' 10 byte) into packed decimal format in one cobol program, and in another cobol program same packed decimal value converted back to string ('12345 ' 10 byte)
I tried with below logic
Converting string to packed:-
Moved '12345 ' to numeric field 9(09)
move numeric field 9(09) to packed field S9(10) COMP-3
packed field = packed field * 10
Move packed field to X(05) (here I got value as x'0123450000')
Converting packed to string:-
Move X(05) to packed field S9(10) COMP-3
packed field = packed field / 10
Move packed field to numeric field 9(09) (here I got value as ' 123450000') <---- here I want value as '12345 ' but not working
Can anyone please tell me logic for this?