GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  Mainframe  >  COBOL
Go To First  |  Previous Question  |  Next Question 
 COBOL  |  Question 76 of 159    Print  
I have 50 records , i want access records from bottom onwards. what is the logic for that?

  
Total Answers and Comments: 3 Last Update: January 13, 2007     Asked by: manoj 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
October 05, 2006 10:34:52   #1  
prasad        

RE: hi, i have 50 records , i want access records fro...
define the cursor in descending order, then u can access them from bottom.
 
Is this answer useful? Yes | No
November 27, 2006 00:40:47   #2  
susi        

RE: hi, i have 50 records , i want access records fro...

In case of sequential files, it is not possible to directly read them from the last record until we read the records to a table and then go ahead to read from the last record.

in case of KSDS, we can move high-values to the variable and then read it from the highest value.


 
Is this answer useful? Yes | No
January 12, 2007 07:13:23   #3  
       

RE: I have 50 records , i want access records from bo...

Hi,

 It is possible through jcl. For example if the input file contains 80 record length then

 In sort, INREC=(1:1,80,81:SEQNUM,6,ZD),SORT FIELDS=(81,6,ZD,D),OUTREC=(1:1,80)

 1) Using inrec we need to generate the sequential number starts from position 81.

     For example

           1) First 1-80 bytes contains the actual record and from position 81 we need to generate sequential 

 number using inrec i.e 000100, 000200 upto 50 records.  

           2) After generating all those numbers, sort we takes place in descending order.

           3) Using outrec we have to move the first 80 bytes to the output file.

 After doing this sort in first step in jcl, you can read the output file in second step

 Thanks

 Karthikkumar.P


 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 




About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape