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


I have two files , file1 is input file it contains
10,20,30,....,records
but i want to display the records in file 2 as reverse order
.how can we do by using jcl& cobol(dont use array)
please any one can tell me the answer

Answers were Sorted based on User's Feedback



I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / abhishek

First open file-1 as:

OPEN INPUT FILE-1 REVERSED

->If REVERSED clause is specified at the time of opening a
particular file, then that file can be read in reverse
direction.

Now we can read file-1 like
READ FILE-1
INTO ws-record
NOT AT END
PERFORM PARA-1
END-READ

PARA-1
WRITE FILE-RECORD
FROM WS-RECORD
END-WRITE

Is This Answer Correct ?    11 Yes 1 No

I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / rajesh

using count statement

Is This Answer Correct ?    3 Yes 1 No

I have two files , file1 is input file it contains 10,20,30,....,records but i want to display th..

Answer / vaneesh

We can sort the input file in descending order usign DFSORT

sort fields=(1,3,CH,D)

then simply read the sorted file in the program and display
it in the spool.

Is This Answer Correct ?    2 Yes 2 No

Post New Answer

More COBOL Interview Questions

Differentiate between structured cobol programming and object-oriented cobol programming.

0 Answers  


What are differences between Static Call and Dynamic Call?

10 Answers   IBM, KBC, Keane India Ltd, Verizon,


We know that size of redefine and redefining need not to be same..Then does the below case true 01 ws-date pic 9(6). 01 ws-redf-date REDEFINES ws-date 05 ws-year pic 9(4) 05 ws-mon pic 9(2) 05 ws-day pic 9(2)

1 Answers   Cap Gemini,


) how do u code after getting data?

0 Answers   IBM,


what is sort? whis is internal & external sort ?when do u go for inter sort & external sort? tell about some sort utilites?

2 Answers   BirlaSoft,


When would you use in-line perform?

2 Answers  


How do define dynamic array in cobol.

0 Answers  


what are the working storage fields in BMS macro?

2 Answers   IBM,


Define cobol?

0 Answers  


Name the divisions in a COBOL program ?

7 Answers  


How do define Dymanic array in cobol how do u define single demensional arry and multidymensional arry in ur cobol.

4 Answers   Cap Gemini,


I have the file which is having the extension no as records. sample file will look like below. 2310 3410 3256 4350 3781 5408 I need to replace the record which is starting with 3 to 5 (i.e) 3410 to 5410. How can we do it through cobol and cobol-db2 program? I need the possible logic?

5 Answers   RBS,


Categories