i need some clarification

hi all,
i am new to the natural world.i need some clarification on following data

  1. diff betw escape top/ respoition
  2. diff betw escape bottom/ immediate
    3.diff betwee write work variable /record
    4.diff between read and read mutifetch
    when to use mutifetch
    thanks

hi steve
i am great fan of u .
help me genius

First, a few minor criticisms.
a - Most of your questions can be answered easily by reading the Statements manual.
b - This forum - Natural Code Samples - is where you offer examples and techniques. Questions should be posted in the “Natural on Mainframes” or “Natural on Open Systems” forums.
c - You haven’t stated your platform. I’ll assume it is mainframe.

As to your questions:

1 - ESCAPE TOP with or without REPOSITION
ESCAPE TOP can be used in any of Natural’s looping statements to return to the top of the loop. ESCAPE TOP REPOSITION can be used only in a READ loop in which you have coded WITH REPOSITION. REPOSITION allows you to change the FROM value of the READ.

2 - ESCAPE BOTTOM with or without IMMEDIATE
ESCAPE BOTTOM is used to leave a loop; if an AT END OF DATA block is present, it is executed. ESCAPE BOTTOM IMMEDIATE is used to leave a loop, but ignores the AT END OF DATA block. The IMMEDIATE clause is redundant if no AT END OF DATA block is present.

3 - WRITE WORK with or without VARIABLE or RECORD
WRITE WORK does not have a RECORD clause.

For each WRITE WORK statement, Natural computes the logical record length, based on the field list. If more than one WRITE WORK statement exists for the same file, Natural compares the record lengths. If they do not match, the compiler issues an error message. If the records are intended to be fixed length, you must correct the WRITE WORK statements so that the lengths match. If the records are intended to be variable length, then code the VARIABLE keyword on each WRITE WORK statement.

4 - READ with and without MULTI-FETCH
In a READ loop, Natural issues a READ command to Adabas for each iteration of that loop. Performance can be improved by coding the MULTI-FETCH clause which causes Natural to request Adabas to return multiple records in a single call. Natural then replaces physical Adabas calls with accesses to the buffer of returned records.

If used improperly, Multi-fetch can drastically degrade performance. Multi-fetch should be used carefully and selectively.

Talk to a senior Natural developer in your shop for recommendations of how Multi-fetch works, when to use it, and how best to use it. This type of forum can’t do justice to such a complicated topic. Or have your organization contact Software AG (or one of the third-party instructors on these forums, such as yours truly) to arrange a training or mentoring session that includes multi-fetch.

Hi karthikeyan;

First, thanks for the kudo at the end of your post.

Next I would like to add to two points made by Ralph in his excellent detailed response to your questions.

First, since you have read many of my posts, you have seen my comment:

             Education, Education, Education

This is not an idle add on to some of my posts. Natural is not just a programming language, it is a development platform. There are lots of editor tricks, shortcuts, etc that are part of Natural. There is a whole family of “terminal commands”, which all start with percent signs (default) and can also be issued from within a program by the statement SET CONTROL. There are many System Variables and Functions. There are many ways to write very inefficient Natural code, and fewer ways to write efficient code. The list goes on and on.

The point is that you will NOT become a proficient Natural programmer without education. Indeed, the converse often occurs. A “newbie” is given code to read to “learn” Natural. If the code is poor, the result is a poor programmer.

The second point is an add on to Ralph’s second point. IMMEDIATE also affects the execution of a “forced” AT BREAK clause. If you ESCAPE BOTTOM from a loop, and have an AT BREAK clause, there is a final “forced” AT BREAK at the end of the loop, just prior to the execution of an AT END OF DATA clause (if present). If you have ESCAPE BOTTOM IMMEDIATE, there is no forced AT BREAK and no AT END OF DATA.

To repeat the first point from my post, and from Ralph’s; get management to provide you with Natural training.

steve

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6310win/sm/escape.htm#REPOS

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6310win/sm/escape.htm#IMMEDIATE_B

http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6310win/sm/writewor.htm#VARIABLE

… all found via http://techcommunity.softwareag.com/ecosystem/documentation/natural/nat6310win/sm/sm-over.htm

thanks alot for ur answers …