Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need to read last record from the file directly using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
hnharish

New User


Joined: 30 Aug 2005
Posts: 22

PostPosted: Sun Mar 27, 2011 5:26 pm    Post subject: Need to read last record from the file directly using REXX
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: 1925
Location: UK

PostPosted: Sun Mar 27, 2011 5:42 pm    Post subject:
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: 22

PostPosted: Mon Mar 28, 2011 12:57 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Mon Mar 28, 2011 1:03 pm    Post subject:
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: 1068
Location: Oostende, Belgium

PostPosted: Mon Mar 28, 2011 2:25 pm    Post subject:
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: 1925
Location: UK

PostPosted: Tue Mar 29, 2011 12:16 am    Post subject:
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: 1002
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Mar 29, 2011 1:03 pm    Post subject:
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: 1925
Location: UK

PostPosted: Tue Mar 29, 2011 2:46 pm    Post subject:
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: 6970
Location: porcelain throne

PostPosted: Tue Mar 29, 2011 5:56 pm    Post subject:
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: 1925
Location: UK

PostPosted: Wed Mar 30, 2011 2:07 pm    Post subject:
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    Post subject:
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: 1068
Location: Oostende, Belgium

PostPosted: Wed Apr 06, 2011 12:39 am    Post subject:
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 5 Thu Nov 23, 2017 3:32 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts Rexx to send an email without SMTP Se... upendrasri All Other Mainframe Topics 9 Sun Nov 19, 2017 7:59 pm
This topic is locked: you cannot edit posts or make replies. ISREDIT Macro is not returning back t... nico_neoz CLIST & REXX 21 Sat Nov 18, 2017 7:40 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us