IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Need to read last record from the file directly using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
hnharish

New User


Joined: 30 Aug 2005
Posts: 23

PostPosted: Sun Mar 27, 2011 5:26 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sun Mar 27, 2011 5:42 pm
Reply with quote

No. It is not possible. Other languages may depending on file organisation and capabilities of the language.
Back to top
View user's profile Send private message
hnharish

New User


Joined: 30 Aug 2005
Posts: 23

PostPosted: Mon Mar 28, 2011 12:57 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Mar 28, 2011 1:03 pm
Reply with quote

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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Mon Mar 28, 2011 2:25 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 29, 2011 12:16 am
Reply with quote

Oh boy! I do like some light entertainment after a day of driving around town.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Mar 29, 2011 1:03 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 29, 2011 2:46 pm
Reply with quote

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 icon_lol.gif 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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Mar 29, 2011 5:56 pm
Reply with quote

Quote:
except it is contracted rate not salary like before

undoubtedly a bank.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Mar 30, 2011 2:07 pm
Reply with quote

As it happens - same bank, different area. Fingers crossed!
Back to top
View user's profile Send private message
harindersinghmatharu

New User


Joined: 23 Mar 2011
Posts: 1
Location: India

PostPosted: Wed Apr 06, 2011 12:13 am
Reply with quote

@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
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Wed Apr 06, 2011 12:39 am
Reply with quote

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:
  • u
  • ur
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
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Fri Oct 11, 2019 6:57 pm
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Oct 12, 2019 1:29 am
Reply with quote

2 posts deleted - as per Garry's comments.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top