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
 

 

In what scenarios can GET SAME be used

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: In what scenarios can GET SAME be used
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: 2360
Location: Israel

PostPosted: Wed Jun 28, 2006 11:47 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> Java & MQSeries All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORT -JOINKEY----Different scenarios Frank Yaeger DFSORT/ICETOOL 6 Wed Aug 04, 2010 1:01 pm
No new posts Write in separate output files based ... dick scherrer JCL & VSAM 10 Mon Nov 02, 2009 11:28 pm
No new posts In what scenarios are AIVs to be used Borebeat Java & MQSeries 1 Thu May 11, 2006 8:55 pm


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