View previous topic :: View next topic
|
Author |
Message |
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
Hi Team,
I need to read last record from the file directly without reading each and every record and then reaching last record. Could you please tell me if this is possible using REXX program.
Thanks,
Harish |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
No. It is not possible. Other languages may depending on file organisation and capabilities of the language. |
|
Back to top |
|
|
hnharish
New User
Joined: 30 Aug 2005 Posts: 23
|
|
|
|
Nic Clouston wrote: |
No. It is not possible. Other languages may depending on file organisation and capabilities of the language. |
Hi Nic,
Thanks for your reply.
If it is not possible to read the last record directly.Could you please tell me is it possible to read the record in reverse order using REXX.
Thanks,
Harish. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
yes, invoke sort to reverse the record sequence of the file,
then read the output of sort.
first record read will be the last record in the originial file. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
hnharish wrote: |
If it is not possible to read the last record directly.Could you please tell me is it possible to read the record in reverse order using REXX. |
Are you a complete mpumbavu, or just pretending?
Reading in reverse order implies that you can read the last record directly, and you've already been told that this is not possible! |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Oh boy! I do like some light entertainment after a day of driving around town. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Quote: |
Oh boy! I do like some light entertainment after a day of driving around town.
|
....especially if reversing around town, Nic.
Garry. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Garry - my reversing is so bad that that is when most of my little 'comings together' occur. Hopefully I can put all that behind me (ouch) and could be back in Dublin soon. Maybe bugging you again but not sure where this proposed contract is but it smacks of the bank except it is contracted rate not salary like before. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
except it is contracted rate not salary like before |
undoubtedly a bank. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
As it happens - same bank, different area. Fingers crossed! |
|
Back to top |
|
|
harindersinghmatharu
New User
Joined: 23 Mar 2011 Posts: 1 Location: India
|
|
|
|
@harish: lets say u read ur file into a stem variable called filerec.
then the count of number of records read will be in filerec.0
now using the value in filerec.0 u can directly access the last record.
the point here is that YOU WILL NOT BE READING THE FILE IN REVERSE ORDER... instead u will be reading the entire file in one go and then accessing the last record. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
harindersinghmatharu wrote: |
@harish: lets say u read ur file into a stem variable called filerec.
then the count of number of records read will be in filerec.0
now using the value in filerec.0 u can directly access the last record.
the point here is that YOU WILL NOT BE READING THE FILE IN REVERSE ORDER... instead u will be reading the entire file in one go and then accessing the last record. |
Please explain the meaning of the words:
Why the fecking hell can't you use normal English? This is a forum for professionals, not for SMS junkies!
By the way your suggestion is totally crap, and impossible to execute if the file has several million records. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
The original topic is 8 years old !! Don't try piggy-backing on old posts - and, in any case, your question has nothing to do with the original topic. I fact, it belongs in a different part of the forum.
Analyse the dump for "A severe error (code X'0586') has occurred in
module DFHAPSI."
Garry. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
2 posts deleted - as per Garry's comments. |
|
Back to top |
|
|
|