01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING".
01 NAME2 PIC X(13).
now I want to display the value of NAME1 in reverse order
i.e value should be displayed as "GNIMMARGORP LOBOC"
HOW can I do that ??? please let me know if any one knows
it.
Answer Posted / rajani
working-storage section.
01 name1 pic x(17) value 'cobol programming'.
01 name2 pic x(17).
01 i pic 99.
01 j pic 99 value 1.
procedure division.
perform para varying i from 17 by -1 until i<1.
display name2.
stop run
para.
move name1(i:1) to name2(j:1).
add 1 to j.
| Is This Answer Correct ? | 11 Yes | 1 No |
Post New Answer View All Answers
i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?
Differentiate cobol and cobol-ii. (Most of our programs are written in cobolii, so, it is good to know, how, this is different from cobol)?
Mention the guidelines to write a structured cobol program?
Why did you choose to work with ibm mainframe cobol programming?
What is the difference between structured cobol programming and object alternativelyiented cobol programming?
Which division and paragraphs are mandatory for a COBOL program?
how do you reference the variable block file formats from cobol programs
What are all the divisions of a COBOL program?
What is length is cobol?
Whats the difference between search & search ALL?
How to remove 2 duplicate records and copy only one using job control language?
Discuss about changing dataset name in proc.
Difference between array and sub-script ?
What is the LINKAGE SECTION used in COBOL?
Can we change the password using ALTER? anyone tried and changed?