Re: 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.

Answers were Sorted based on User's Feedback



Re: 01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to disp..

Answer / sruthi

Hi Subu,
first of all the size of the var NAME1 is 13. You are
passing more than 13 chars. Some data will be truncted.
There are 2 methods to reverse the string.
one is move reference modification.it is very lengthy
process and other is reverse function.
syntax: move function reverse(NAME1) to NAME2

Is This Answer Correct ?    12 Yes 0 No

Re: 01 NAME1 PIC X(13) VALUE "COBOL PROGRAMMING". 01 NAME2 PIC X(13). now I want to disp..

Answer / praveen ellur

Reverse function in Cobol will do this for u.

Here is the syntax.
FUNCTION REVERSE ('COBOL PROGRAMMING')

Is This Answer Correct ?    5 Yes 0 No

Post New Answer

More COBOL Interview Questions

I have a program with an Array of 5000 occurences which is being passed from 5 sub levels to the front end screen. Thess 5 programs using each 5*2 = 10 different arrays with size as 5000. This is causing the transaction to utilize more storage consupmtion. I am looking to reduce the storage consumption. As part of that initially i thought Dynamic array may solve my problem. After viewing the comments given i see its same as normal array. IS there any other way we can resolve this issue?

0 Answers   HCL,


What is the difference between a subscript and an index in a table definition?

3 Answers   TCS,


what is a load module ?

3 Answers   TCS,


When would you use in-line perform?

2 Answers  


How do define dynamic array in cobol.

0 Answers  






If i got a job on mainframe technology, will i have a bright future?. Some people are discouraging me. Let me know, is it true? Please bring back me from the confusion.

2 Answers  


How to recover a deleted source physical file from library?

1 Answers   HCL,


If you were passing a table via linkage, which is preferable - a subscript or an index?

3 Answers   TCS,


What divisions, sections and paragraphs are mandatory for a COBOL program?

8 Answers   Arigo Infotech,


we can use set true for condition names.. similarly can we code set to false in cobol pgm? will it work?

1 Answers  


What is the point of the REPLACING option of a copy statement?

3 Answers  


What is SSRANGE, NOSSRANGE ?

5 Answers  


Categories