IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to use Read/Find statment....


IBM Mainframe Forums -> Java & MQSeries
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
purushottam

New User


Joined: 26 Feb 2007
Posts: 37
Location: pune

PostPosted: Mon Mar 02, 2009 8:37 pm
Reply with quote

To speed up the process I am planning to use the super descriptor in READ/FIND statement.

Super descriptor ===>> NUM-LOC-STUS-ITEM-TYPE (A15)
which consist of
NUM ( N9)
LOC (A4)
STATUS (A1)
ITEM-TYPE (A1)

Here I want to read the record only if it satisfy the condition like

NUM = 123456789 -555555555 (Entire range) ===>> Here I can use Starting From
LOC = 9999
STATUS = A
ITEM-TYPE = A OR B OR C (means more than one value) ==>> Here I need help

I want to use above all 4 conditions in READ loop only (No IF check's) Can any one please guide me how to do it in NATURAL
Back to top
View user's profile Send private message
beruoist

New User


Joined: 14 Nov 2007
Posts: 70
Location: mumbai

PostPosted: Tue Mar 03, 2009 1:22 pm
Reply with quote

Why do you not want to club if with the read/find...because it will be the easiest way to perform this.

Do you think there is any other way...of doing this other than if ?

Pls Share

Regards
Beruoist
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Mar 03, 2009 3:36 pm
Reply with quote

If the values of ITEM-TYPE are consecutive (like A-D, G-Z etc.), then you can use STARTING FROM - ENDING AT clauses. If not, you might want to consider ACCEPT/REJECT statements.

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

New User


Joined: 26 Feb 2007
Posts: 37
Location: pune

PostPosted: Tue Mar 03, 2009 6:38 pm
Reply with quote

Thanks for your reply...

The values of ITEM-TYPE are not consecutive values are 'L' OR 'R' OR 'Y' OR '6' OR '8' OR '9', also i found in manuals that ACCEPT/REJECT criterion is evaluated after the record has been selected/read. So i am not sure whether it is equvalent to IF condition (time taken to complete the process will be the same) ???

If no other ways then i would opt for 4 seprate read/find loops.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Mar 03, 2009 6:57 pm
Reply with quote

From the logic point of view - ACCEPT/REJECT are exactly like IF. From the performance point of view - ACCEPT/REJECT are slightly more efficient then IF, as Natural processes the record internally without waiting for IF. In any case, for huge file processing, it is not recommended to use ACCEPT/REJECT, and separate READs are a totally accepted solution.

O.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Java & MQSeries

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Random read in ESDS file by using RBA JCL & VSAM 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top