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

GET Statement while accessing ADABAS files


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

New User


Joined: 04 May 2008
Posts: 3
Location: Stockholm, Sweden

PostPosted: Mon Jun 01, 2009 2:56 pm
Reply with quote

Hi,

I am an entry level programmer in Natural/ADABAS.

I would like to know how to use GET Statement while accessing ADABAS files.

Thanks a lot for your time.

Cheers,
Gatbys.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Tue Jun 02, 2009 12:33 am
Reply with quote

The GET statement is well documented in Software AG's manual: Natural Statements, with great exaplanation and pretty good examples.

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

New User


Joined: 16 Jul 2009
Posts: 3
Location: pune

PostPosted: Tue Jul 21, 2009 2:18 pm
Reply with quote

Get statement is used to make avaialable a record for processing when the isn is known.
get is mostly used with in a READ or FIND loop to get the ISN number like
DEFINE DATA LOCAL
1 PERSONS VIEW OF EMPLOYEES
2 PERSONNEL-ID
2 NAME
2 FIRST-NAME
1 SALARY-INFO VIEW OF EMPLOYEES
2 NAME
2 CURR-CODE (1:1)
2 SALARY (1:1)
1 #ISN-ARRAY (B4/1:10)
1 #LINE-NR ( N2)
END-DEFINE
/********************************************************************
FORMAT PS=16
LIMIT 10
READ PERSONS BY NAME
MOVE *COUNTER TO #LINE-NR
MOVE *ISN TO #ISN-ARRAY (#LINE-NR)
DISPLAY #LINE-NR PERSONNEL-ID NAME FIRST-NAME
/********************************************************************
AT END OF PAGE
INPUT / ’PLEASE SELECT LINE-NR FOR SALARY INFORMATION:’ #LINE-NR
IF #LINE-NR = 1 THRU 10
GET SALARY-INFO #ISN-ARRAY (#LINE-NR)
WRITE / SALARY-INFO.NAME
SALARY-INFO.SALARY (1)
SALARY-INFO.CURR-CODE (1)
END-IF
END-ENDPAGE
END-READ
END
Back to top
View user's profile Send private message
Steve Robinson

New User


Joined: 14 Nov 2009
Posts: 12
Location: U.S.

PostPosted: Sun Nov 15, 2009 10:16 pm
Reply with quote

The main use of GET is in conjunction with UPDATE.

Consider the following code (which is potentially poor code)

READ ....
IF ... some rare condition
::::
UPDATE
END-IF
END-READ

Problem. The Natural compiler looks at this code and realizes that any record read by the READ statement might be updated. Hence, the READ generates a read with hold to Adabas, rather than a simple read.

Assuming very few records get updated, this will almost certainly lead to an error message regardign an overflow of the record hold queue.

Instead, one typically codes:

READR. READ ....
IF ... some rare condition
::::
GETR. GET ... *ISN (READR.)
UPDATE (GETR.)
END-IF
END-READ

Now the READ at READR. is a simple read, not a read with hold. (since there are no UPDATE statements that reference the READ)

The read that results from the GET is a read with hold (since the UPDATE references the GET).

There would probably be an END TRANSACTION after the UPDATE (although this might be controlled by a counter; but then you would have to worry about an ET timeout).

steve
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 Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top