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

In what scenarios can GET SAME be used


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

New User


Joined: 10 Apr 2006
Posts: 13

PostPosted: Mon Jun 26, 2006 1:01 pm
Reply with quote

Hi,

1) I am reading a table using say READ loop. Now based on some condition, I want to read again from the starting value. Is there any Natural Command for this functionality ?

2) In what scenarios can GET SAME be used ?

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

Global Moderator


Joined: 27 Dec 2005
Posts: 2359
Location: Israel

PostPosted: Wed Jun 28, 2006 11:47 am
Reply with quote

From the manual:
Quote:
The GET SAME statement is used to re-read the record currently being processed. It is most frequently used to obtain database array values (periodic groups or multiple-value fields) if the number and range of existing or desired occurrences was not known when the record was initially read.


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

New User


Joined: 01 Apr 2005
Posts: 58

PostPosted: Tue Jul 04, 2006 5:56 pm
Reply with quote

For 1)
You will need to use a repeat loop as below

Code:

FLAG := 0
REPEAT
  READ    STARTING FROM XYZ
    stmts
    IF condition1
      ESCAPE BOTOM
    END-IF
    stmts
    if condition2
      FLAG := 1
      ESCAPE BOTTOM
    END-IF
  END-READ
UNTIL FLAG NE 0
End-REPEAT


In the above code, when ever condition1 satisifes, it will restart the read loop and when condition2 satisfies, it will come out of read loop. Hope this is what you needed.
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 SORT -JOINKEY----Different scenarios DFSORT/ICETOOL 6
No new posts Write in separate output files based ... JCL & VSAM 10
No new posts In what scenarios are AIVs to be used Java & MQSeries 1
Search our Forums:

Back to Top