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
 

 

Sequential read after random read.. Possible.. or not

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

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Thu Mar 30, 2006 1:45 pm    Post subject: Sequential read after random read.. Possible.. or not
Reply with quote

Can I read a file sequentially once I have read a record randomly?
Back to top
View user's profile Send private message

thanooz

New User


Joined: 28 Jun 2005
Posts: 99

PostPosted: Thu Mar 30, 2006 1:49 pm    Post subject:
Reply with quote

hi Pollyannaish,

I am not geting explain clearly,i am expecting you r asking i had read a file sequentialy once after do you want to access record randamly or not?


thank's
thanooz.
Back to top
View user's profile Send private message
Pollyannaish

New User


Joined: 09 Jul 2005
Posts: 31
Location: Pune, India

PostPosted: Thu Mar 30, 2006 2:03 pm    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

Sorry for the Vague Question,
OK I'll normalize the flow?

1. I have read a record randomly with a given key.
2. I want to read 2 records below it and two records above it.

I just wanted to know can this be done without pointing( start brows) logic.
can i read the file randomly first with the key and then do read next or read previous.
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 464

PostPosted: Thu Mar 30, 2006 5:11 pm    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

Hi,

Quote:
i read the file randomly first with the key and then do read next or read previous.


Yes you can... if its Key sequential

Regards
Rupesh
Back to top
View user's profile Send private message
elonics

New User


Joined: 05 Jul 2005
Posts: 49
Location: India

PostPosted: Tue Apr 04, 2006 5:02 pm    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

I think you can read a one record randomly and start reading it sequentially when it's access mode is Dynamic. So we definitely need START command for that.

As Rupesh said, I dont think one can read a file randomly if it's access mode is Sequential.



Thanks
E'lonics.
---------------------------------------
I may be the best or atleast better than many but never worst.
Back to top
View user's profile Send private message
elonics

New User


Joined: 05 Jul 2005
Posts: 49
Location: India

PostPosted: Tue Apr 04, 2006 5:06 pm    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

Rupesh said it key sequential. then it is ok..
I misread that.

Thanks
Elonics..
Back to top
View user's profile Send private message
Visvanathan

New User


Joined: 25 Apr 2006
Posts: 5
Location: India

PostPosted: Wed Apr 26, 2006 11:04 am    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

Pollyannaish wrote:
Can I read a file sequentially once I have read a record randomly?


In case of CICS Environment this can be achieved. We have READNEXT & READPERV,thus records prior and after can be read.Correct me if Im wrong.

Thanks,
Visva.
Back to top
View user's profile Send private message
ajayvamsi
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Wed Apr 26, 2006 2:17 pm    Post subject:
Reply with quote

Hi,
u can read the file randomly and from THAT POINT u can read seq
only that matters is, we cannot read the records that are above the record which u have read randomly..!!
Ex:
111
222
333
444
555

in the above input file I read 333 record randomly then we will not be able to read 111,222 records but we will be able to read 444 and 555 sequentially..!!
To read the file sequentially u need not to move any value
to the key field

anyone correct me if I am wrong

Thanks,
ajay
Back to top
View user's profile Send private message
pawaria

New User


Joined: 06 Apr 2006
Posts: 7
Location: Noida

PostPosted: Wed Apr 26, 2006 11:13 pm    Post subject: Re: Sequential read after random read.. Possible.. or not
Reply with quote

Yes Ajay was right! It is possible to read the file sequientally in random access mode But u cannot read the records once your control pass them...U can read post-record but not pre-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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts CICS VSAM RLS READ akodakka CICS 3 Tue Oct 04, 2016 3:09 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts Multi row fetch - "for read only... Nileshkul DB2 3 Sun Aug 14, 2016 12:52 am
No new posts creating a physical sequential file i... Shaheen Shaik JCL & VSAM 8 Wed Jun 29, 2016 3:46 pm


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