Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Concatnation

Status
Not open for further replies.

venkat2003

Programmer
Feb 11, 2003
8
IN
Hi

Pleas let me know any other simple apporach apart from this.

I want to append C OR D indicator for my amount filed based on negative and postive

For example

01 WS-AMT PIC S9(16)V99 COMP-3
01 WS-TEMP1 PIC Z(16).ZZ.
01 WS-SIGN-IND PIC X.
01 WS-TEMP2 PIC X(19)
01 FINALAMT PIC X(20)

IF WS-AMT IS NEGATIVE
MOVE 'D' TO WS-SIGN-IND
ELSE
MOVE 'C' TO WS-SIGN-IND
END-IF
MOVE WS-AMT TO WS-TEMP1
MOVE WS-TEMP1 TO WS-TEMP2

STRING WS-TEMP2 WS-SIGN-IN DELIMITED BY SIZE INTO FINAL-AMT
 
Hi Venkat,

I'm not sure what you're trying to accomplish. What do you plan to do with the field once you rearrange it?

I have a feeling you're taking the long route.

Regards, jack.
 
Code:
01 WS-AMT            PIC S9(16)V99 COMP-3.
01 FINALAMT          PIC 9(16).99+.

...

    MOVE WS-AMT TO FINALAMT
    INSPECT FINALAMT CONVERTING "+-" TO "CD"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top