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 get the result of your program directly on your pc?

2393


What is the difference between Global and External Variables?

1433


State the various causes of s0c1, s0c5 and s0c7.

1140


There are 5 fields and 1000 records in a file. Unload it into an array. Write the syntax for declaration and how will you unload it.

1497


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

1302


Write a cobol program making use of the redefine clause.

1226


) How do u handle errors in BMS macro

2104


Explain about different table spaces.

1153


What is a SSRANGE and NOSSRANGE?

1525


write a cobol logic. i have file that has 10 records .1 record go to first output file and second record goes to 2 output and etc

1292


How do we get current date from system with century in COBOL?

1423


What is report-item in COBOL?

1196


What is the difference between Call and a Link?

1261


What is rmode(any) ?

1327


how do you reference the printer file formats from cobol programs

1276