Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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 / jagan

This should convert the string in reverse order without any
built-in functions . And one more thing is COBOL PROGRAMMING
is actually 17 characters.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 NAME-1 PIC X(17) 'COBOL PROGRAMMING'
01 NAME-2
05 NAME-21 PIC X(1) OCCURS 17 TIMES.

01 I PIC X(2)
01 J PIC X(2)


PROCEDURE DIVISON.
MAIN-PARA.
MOVE 0 TO J.
PERFORM READ-NAME VARYING I FROM 17 BY -1 UNTIL I > 0.
STOP RUN.


READ-NAME
ADD 1 TO J.
MOVE NAME-1(I) TO NAME-21(J).
END-READ-NAME.

Correct me in case any problem with above code.

Is This Answer Correct ?    7 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

1144


How do define dynamic array in cobol. how do you define single dimensional array and multidimensional array in your cobol?

1239


How arrays can be defined in COBOL?

1209


Can a Search can be done on a table with or without Index?

1285


How to know whether the module is dynamical or statistical?

1132


How to get the last record in vsam file in cluster? And how can you get the ksds file records into cobol program?

1157


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

1222


Write some characteristics of cobol as means of business language.

1138


how do you reference the printer file formats from cobol programs

1212


What is the difference between next sentence and continue in cobol programing language?

1220


What are declaratives and what are their uses in cobol?

1197


Give some examples of command terminators?

1251


if we display var1 then what will b displayed in below condition. 77 var1 pic s9(2) value -10. 77 var1 pic s9(2) value -11. " " " -12. " " " -13. -14 ... ... -19.

6575


What is the local-storage section?

1141


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

2371