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
 
How to browse the file from the last record to first record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
ipavan

New User


Joined: 12 Jun 2005
Posts: 28
Location: Hyderabad

PostPosted: Sun Oct 23, 2005 12:34 pm    Post subject: How to browse the file from the last record to first record
Reply with quote

Hi can any one help me out,

My file(PS or ESDS or KSDS) has 1 million records . How to browse the file from the last record to first record.

I should not use any tools.



Thanks in advance,

pavan.
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Oct 24, 2005 11:02 am    Post subject: Re: browing a file
Reply with quote

Hi Pavan,

1> Add a SEQ NUM to each record.
2> SORT the file DESCENDING based on SEQ NUM.
3> BROWSE record by record.

Steps given above can be performed by DFSORT.
Make a search in the forum to get solution for the first step. Get back in case any problem with your file structure.

Regards,

Priyesh.
Back to top
View user's profile Send private message
ikumar

New User


Joined: 02 Aug 2005
Posts: 81

PostPosted: Mon Oct 24, 2005 11:47 am    Post subject: Re: browing a file
Reply with quote

Hi,
1) If you want to browse PS file in reverse, you must read all the records prior to that. Other way is, you can reverse the order of the records in your file through SORT utility using SEQNUM...
For example,
INREC FIELDS=(1,80,SEQNUM,8,ZD) // assigns the SEQNUM to 81st col
SORT FIELDS=(81,8,ZD,D) // sort the seqnum in DESC order
OUTREC FIELDS=(1,80) // write the output excluding the SEQNUM.

So, last record becomes the first record and you can use that output file in your program.

2) KSDS: move high-values to KEY field and do a start not greater than and a read backward and you get the last record.

3) ESDS: If you know RBA of the last record you can directly access last record, otherwise you need to follow the same steps as you do for your PS file.

Plz let me know if i am wrong anywhere....

Cheers,
Kumar.
Back to top
View user's profile Send private message
ipavan

New User


Joined: 12 Jun 2005
Posts: 28
Location: Hyderabad

PostPosted: Mon Oct 24, 2005 8:13 pm    Post subject: Re: browing a file
Reply with quote

Thanks a lot Kumar for your reply


Regards

Pavan
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Thu Oct 27, 2005 3:38 pm    Post subject:
Reply with quote

Hi,

q1 > INREC FIELDS=(1,80,SEQNUM,8,ZD) // assigns the SEQNUM to 81st col

Can you explain how the sequence number get added here ??

q2> SORT FIELDS=(81,8,ZD,D) // sort the seqnum in DESC order
here the file is sorted by starting from 81st columns and leangth 8 in descending order... am i correct ?

Thanks in advance.

Murali
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Oct 28, 2005 4:11 am    Post subject:
Reply with quote

Isn't SORT a tool?
Back to top
View user's profile Send private message
murali922

New User


Joined: 25 Jul 2005
Posts: 92
Location: India

PostPosted: Fri Oct 28, 2005 9:17 am    Post subject: Re: How to browse the file from the last record to first rec
Reply with quote

Yep. Sort is a tool.

Just want to know how you add the seq. number !!!

Cheers,
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Nov 02, 2005 4:58 am    Post subject:
Reply with quote

Sorry Murial, the ques wasn't directed at you.

But on 2nd thought, a computer is a tool too. I wonder what Paven meant by that comment?
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

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