COBOL program to read the string ' BOMBAY' in reverse order as 'YABMOB'
Answer Posted / 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 |
Post New Answer View All Answers
how do you reference the esds vsam file formats from cobol programs
How do you get the data to code the BMS macro?
what happens if parmparameter passes zero bytes to the program
How do define dynamic array in cobol.
How are the next sentence and continue different from each other?
How to fetch 1000 error records from VSAM file(Eg: 1000000 records present) while getting SOC7 abend ?
how to refer the data field?
How do you reference the following file formats from cobol programs?
Discuss about changing dataset name in proc.
What is the difference between a binary search and a sequential search what are the pertinent cobol?
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?
if we have " ibm mainframe ",in that how to remove first and last leading space eg:"ibm mainframe" like that the answer we need
What are the different rules of SORT operation?
What are the different types of condition in cobol and write their forms.
Our issue is there seems to be a disconnect, or no link, between our SELECT statement and our SD. We had SELECT SORT-FILE and SELECT SORT-FILE ASSIGN TO SORTWRK. ASSIGN TO SORTWRK1 SORTWRK2 SORTWRK3 SORTWRK4. with SD SORT_FILE RECORD CONTAINS 7833 CHARACTERS. In either case, at run time, the system ignored our SORTWRK# DD statements and allocated 16 sort works with the SORTWK## naming convention. Any ideas why the system does not recognize the connection? We do not even need the SORTWRK DD statements. Thanks