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

input:-AABBCCDDEFGHIIJ
output:- ABCDEFGHIJ
Here in input we hav the duplicate characters i.e repeating
characters.SO we should eliminate the duplicate characters
and should display the output in ascending order.

Answer Posted / vaneesh

Here I am considering INPUT to COBOL working storage
variable and not from file. (If it is input from file then
answer above by Adithya is right).

01 WS-INPUT PIC X(52) VALUE 'AABBCCDDEFGHIIJ.....ZZ'
05 WS-ALPHABET-INP PIC X OCCOURS 52 TIMES.

01 WS-OUPUT PIC X(26).
05 WS-ALPHABET-OUT PIC X OCCOURS 26 TIMES.

01 SUBSRIPTS
05 WS-SUBA PIC 9(2).
05 WS-SUBB PIC 9(2) VALUE 1.

PROCEDURE DIVISION.

PERFORM VARYING WS-SUBA FROM 2 BY 2 UNTIL WS-SUBA > 52

MOVE WS-ALPHABET(WS-SUBA) TO WS-ALPHABET-OUT(WS-SUBB)

ADD +1 TO WS-SUBB

END-PERFORM.

DISPLAY WS-OUPUT

STOP RUN.

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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

1118


How are the next sentence and continue different from each other?

1278


how we sort two input files based on a common column and giving one o/p file please send me the coding logic?

2113


What is the default value(s) for an initialize? What keyword will allow for an override of the default?

1104


State the various causes of s0c1, s0c5 and s0c7.

1061


What is the difference between PIC 9.99 and 9v99 in COBOL?

1310


How you can characterize tables in cobol?

1177


What is inspect in cobol ?

1282


Can we change the password using ALTER? anyone tried and changed?

1991


How to use the same COBOL program in Batch and CICS on lines? explain with an example

2366


How you can read the file from bottom?

1133


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)?

1098


What is the difference between comp and comp-3 usage?

1176


What is the difference between perform … with test after and perform … with test before?

1413


What are the different rules to perform a Search?

1077