I want to know why WS-DATE-S is being displayed as 2008010A and not 20080101. Am i moving in a wrong manner. Please note that i want to keep the PIC Clause of WS-DATE-S as S9(8) only and i want to display it correctly. [/code]
The COBOL Language Reference states that a signed USAGE DISPLAY numeric field has the sign overlaid on the high order bits of the last byte of the field; a positive value is C and negative D. The character 'A' in the collating sequence is C1 which is interpreted as a 01 with a plus sign (C0) overlaid on it. You are not moving in a wrong manner; COBOL is behaving exactly as the manual documents.
Please note that i want to keep the PIC Clause of WS-DATE-S as S9(8) only and i want to display it correctly.
You pays your money, you takes your pick -- keep the S on the PIC clause and you're going to see letters (or special symbols) for the last character of the displayed data, or leave off the S and see numbers in that character. Those are your choices -- nothing else is supported by COBOL.