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
 

 

GET Statement while accessing ADABAS files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Java & MQSeries
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    Post subject: GET Statement while accessing ADABAS files
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: 2360
Location: Israel

PostPosted: Tue Jun 02, 2009 12:33 am    Post subject:
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    Post subject: Reply to: GET Statement while accessing ADABAS files
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    Post subject:
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    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 Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Accessing first bit of PD value rajatbagga DFSORT/ICETOOL 11 Wed May 03, 2017 6:03 am
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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