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
 

 

Reading the file randomly can I use THRU clause

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

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Mon Jun 12, 2006 9:05 am    Post subject: Reading the file randomly can I use THRU clause
Reply with quote

the below code which I reading the file randomly can I use THRU clause here for the record key
defining the file as:--

SELECT JARBI-FILE
ASSIGN TO JARBI
ORGANIZATION INDEXED
ACCESS RANDOM
FILE STATUS WS-JABI-STATUS
RECORD KEY JABI-KEY-LOGO THRU
JABI-KEY-CREDIT-PLAN.


copy book:=

01 primarykey.
02 JABI-KEY-name
02 JABI-KEY-LOGO
02 JABI-KEY-age
02 JABI-KEY-CREDIT-PLAN
02 JABI-KEY-city


please tell me if this wrong and tell me how to code the primary using the fields JABI-KEY-LOGO,JABI-KEY-age,JABI-KEY-CREDIT-PLAN only

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

prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Mon Jun 12, 2006 1:46 pm    Post subject:
Reply with quote

If you can change your copy book then you can as well declare the three fields that make the key as one
01 primarykey.
02 JABI-KEY-name
02 PRIMARYKEYS
05 JABI-KEY-LOGO
05 JABI-KEY-age
05 JABI-KEY-CREDIT-PLAN
02 JABI-KEY-city

and use that field as RECORD KEY

SELECT JARBI-FILE
ASSIGN TO JARBI
ORGANIZATION INDEXED
ACCESS RANDOM
FILE STATUS WS-JABI-STATUS
RECORD KEY PRIMARYKEYS.

Offcourse you can try this only if can change the copy book
Back to top
View user's profile Send private message
ajayvamsi
Currently Banned

New User


Joined: 21 Jul 2005
Posts: 56
Location: Hyderabad

PostPosted: Mon Jun 12, 2006 2:04 pm    Post subject: Re: Reading the file randomly can I use THRU clause
Reply with quote

Prasad,I cannot change the copybook
Please help out with out changing the copybook

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

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Mon Jun 12, 2006 7:47 pm    Post subject: Re: Reading the file randomly can I use THRU clause
Reply with quote

ajay,

You cannot use the 'THRU' statement in this context.

You only have two options that I see.

1 - define and create a secondary index for the file only with the fields your interested in. I think you may be able to do this under your own ID, I'm not sure, I've never tried. This is not efficient because the system will have to sequentialy read the entire file to create the index.

2 - Sequentialy read the file, picking out the records you need. Probably, overall the fastest way.

Dave
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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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