Clicky
Skip to Content
Custom Search

Reply to comment

Alan.R.Wynne
Offline
Joined: 07/07/2011
Reverse Command

Not as far as i am aware of but COBOL can call C functions that may achieve the same result. i have not done that yet so am unaware of exactly how to go about that.

otherwise you can always do the following:

01 i pic s9(4) binary.
01 j pic s9(4) binary.

01 original-string pic x(255).
02 reversed-string pic X(255).

move length of original-string to j

perform varying i from 1 by +1 until i > length of original-string

move original-string(i:1) to reversed-string(j:1)
subtract 1 from j

end-perform

Reply

  • Allowed HTML tags:
      1. Lines and paragraphs break automatically.

    More information about formatting options

    CAPTCHA
    This question is for testing whether you are a human visitor and to prevent automated spam submissions.

Navigation

Click the +1 button  below to share it with your friends and colleagues

 

Share this if you liked it!

 

Disclaimer



Number of Registered users 714
Theme by Dr. Radut.