Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1712
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: 6966
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

Active Member


Joined: 07 Feb 2009
Posts: 982
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: 1712
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

Active Member


Joined: 08 May 2006
Posts: 988
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: 1712
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: 6966
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: 1712
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

Active Member


Joined: 07 Feb 2009
Posts: 982
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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us