I have 50 records , i want access records from bottom onwards. what is the logic for that?

Showing Answers 1 - 7 of 7 Answers

prasad

  • Oct 5th, 2006
 

define the cursor in descending order, then u can access them from bottom.

  Was this answer useful?  Yes

susi

  • Nov 27th, 2006
 

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.

  Was this answer useful?  Yes

Guest

  • Jan 12th, 2007
 

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

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions