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

Extract only those records from a PS file which are having word 'TEXT' in the records using COBOL? The word TEXT is not present in a particular position in all the records.

Answer Posted / chatgpt

IDENTIFICATION DIVISION.
PROGRAM-ID. EXTRACT-TEXT-RECORDS.
DATA DIVISION.
FILE SECTION.
FD INPUT-FILE.
01 INPUT-RECORD PIC X(100).
FD OUTPUT-FILE.
01 OUTPUT-RECORD PIC X(100).
WORKING-STORAGE SECTION.
01 SEARCH-TEXT PIC X(4) VALUE 'TEXT'.
PROCEDURE DIVISION.
OPEN INPUT INPUT-FILE
OUTPUT OUTPUT-FILE.
READ INPUT-FILE
AT END DISPLAY "No records found."
NOT AT END PERFORM PROCESS-RECORDS.
CLOSE INPUT-FILE
OUTPUT-FILE.
STOP RUN.

PROCESS-RECORDS.
PERFORM UNTIL END-OF-FILE
IF INPUT-RECORD CONTAINS SEARCH-TEXT
WRITE OUTPUT-RECORD
END-IF
READ INPUT-FILE
AT END MOVE 'Y' TO END-OF-FILE
END-PERFORM.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

) How do u handle errors in BMS macro

1968


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

1056


What are INPUT PROCEDURE and OUTPUT PROCEDURE?

1234


Write a program to explain size error.

1153


A table has two indexes defined. Which one will be used by the SEARCH?

1240


i was faced one question- i have value -00001234.56 Suppress the zeroes and the output should be -1234.56 But Not - 1234.56 spaces should not be available after suppressing the zeroes. logic in jcl and cobol?

1269


What is report-item in COBOL?

1104


What rules are followed by the search verb.

1061


What is the Purpose of Pointer in the string?

1032


Have you used comp and comp-3 in your project? And how?

2436


What is rmode(24)

1108


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

2332


What is redefines clause in COBOL?

1257


what happens if parmparameter passes zero bytes to the program

2088


How to know whether the module is dynamical or statistical?

1089