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
 
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 opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 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