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


COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'

Answers were Sorted based on User's Feedback



COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / rashi

MOVE 'BOMBAY' TO WS-STRING.

INSPECT WS-STRING TALLYING WS-COUNT FOR ALL CHARACTERS

MOVE WS-COUNT TO WS-COUNT1.

MOVE 1 TO WS-COUNT2.

PERFORM VARYING WS-COUNT1 BY -1 UNTIL WS-COUNT1 = 0
MOVE WS-STRING(WS-COUNT1:1) TO WS-REV-STRING(WS-COUNT2:1)
ADD 1 TO WS-COUNT2
END-PERFORM.

Is This Answer Correct ?    10 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / gouti

Yes We can By using the funtion reverse

01 MOVE FUNCTION REVERSE(WS-A) TO WS-B

Is This Answer Correct ?    8 Yes 1 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / piyush kumar

We can use the reverse function in cobol for this

Is This Answer Correct ?    4 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / meghraj hulawale

Data Division.
w-s-s.
77 str pic x (6) value 'BOMBAY'.
77 revstr pic x (6).
77 I pic 9 (1).
77 J pic 9 (1) value 1.
77 cnt pic 9 (1).
Procedure Division.
inspect str tallying cnt for all characters before initial space.
move cnt to I.
perform until I < 1
move str (I:1) to revstr (J:1)
add 1 to J
subtract 1 from I
end-perform.
Display revstr.
stop run.

Is This Answer Correct ?    2 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / randy

Hi,

We can use Reverse function.
MOVE FUNCTION REVERSE(WS-STRING) TO WS-REV-STRING

Is This Answer Correct ?    2 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / nanda

********************** Top of Data ***********
ID DIVISION.
PROGRAM-ID. ALLINONE.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-A PIC X(7) VALUE 'NANDA'.
01 WS-B PIC X(7).
PROCEDURE DIVISION.
MOVE FUNCTION REVERSE(WS-A) TO WS-B.
DISPLAY WS-B.
STOP RUN.

Is This Answer Correct ?    2 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / sushree

id division.
prog-id. hello.
data division.
working-storage section.
01 ws-str pic A(6) value 'BOMBAY'.
01 ws-cnt pic 9(1).
01 ws-str1 pic A(1).
01 ws-str2 pic A(6) value space.
procedure division.
inspect ws-str tallying ws-cnt for all characters
display ws-cnt
perform until ws-cnt < 1
move ws-str3(ws-cnt:1) to ws-str1
string ws-str2 delimited by space
ws-str1 delimited by size
into ws-str3
compute ws-cnt = ws-cnt - 1
end-perform.
display ws-str3.
stop run.

Is This Answer Correct ?    1 Yes 0 No

COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'..

Answer / chavanbb33

plz send me the program , how it works

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More COBOL Interview Questions

What will happen if you code GO BACK instead of STOP RUN in a stand-alone COBOL program i.e. a program which is not calling any other program ?

3 Answers  


what is soc7 abend?how u can trace it?

4 Answers   Accenture,


what is the use of filler in cobol programing?

4 Answers   MAT,


Define static linking and dynamic linking.

0 Answers  


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,


can any one give good example for cond 88 level number and for renames pls urgent dudes ?

3 Answers   DELL,


How can I find the maximum value of a field in a file while reading the file dynamically? without using sort function. Suppose i have a file with fields Timestamp, description, teamname, teamnumber.. i have read the file till end and find the maximun value of timestamp which is not in sorted order.. can we use function max(timestamp)?

1 Answers   CGI,


Write some characteristics of cobol as means of business language.

0 Answers  


What are the divisions in a cobol program?

1 Answers  


can we use 77 level no for Redefines?if we use give an example?

3 Answers   Mphasis,


in cobol perform stmt whether it first checks the condition or not

9 Answers  


What are the pertinent COBOL commands?

0 Answers   Satyam,


Categories