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

ID DIVISION.
PROGRAM-ID. TESTPRG4.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-VAR.
10 WS-VARA PIC X(20).
10 WS-VARB PIC X(20).
10 I PIC 99.
10 J PIC 99 VALUE 1.
10 OCR PIC 99 VALUE 1.
10 WS-TAB.
20 WS-REC OCCURS 10 TIMES.
30 WS-ID PIC X(1) .

PROCEDURE DIVISION.
ACCEPT WS-VARA.
MOVE 'A' TO WS-HOLD.
PERFORM VARYING I FROM 1 BY 1 UNTIL I > 20
MOVE WS-VAR(I:1) TO WS-ID(OCR)
ADD 1 TO OCR
END-PERFORM.

PERFORM VARYING OCR FROM 1 BY 1 UNTIL OCR > 20
IF WS-REC(OCR) NOT EQUAL TO WS-REC(OCR + 1) THEN
MOVE WS-ID(OCR) TO WS-VARB(J:1)
ADD 1 TO J
ELSE
CONTINUE
END-IF
END-PERFORM.

DISPLAY WS-VARB.

STOP RUN.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between goback, stop run and exit program in cobol?

1545


What is a scope terminator give example?

1072


What is the difference between structured cobol programming and object alternativelyiented cobol programming?

1199


How to remove the spaces at the end of each record in the output file of variable length, via cobol program?

1128


Which division and paragraphs are mandatory for a COBOL program?

1221


Are you comfortable in cobol or jcl?

1003


What is rmode(any) ?

1209


Explain sorting techniques in cobol program? Provide the sort file definition, the sort statement, its syntax and meaning

1056


i need a small 3d program using inline and outline.

2182


What are the different data types in cobol?

1363


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

2435


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

1974


How arrays can be defined in COBOL?

1160


How did the release of cobol/370 version 1.3 improve the performance of release 1.1?

1042


How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?

2419