View previous topic :: View next topic
|
Author |
Message |
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
Hi Guys,
I need a clarification,
one of my production module that accesses/sweeps IDMS DB uses,
Code: |
ON 1
OBTAIN FIRST CASE-REC....
else
OBTAIN NEXT .... |
Here what is 'ON 1' means,
Note: I understand that it checks, if it is the first read.
My question is How?
Simply ON 1 means what?
Which variable is checked if it contains 1? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Suggest you remove this. . . It is not supported any more by the current compiler. It is also not part of IDMS - it was a COBOL feature.
Quote: |
Simply ON 1 means what?
Which variable is checked if it contains 1?
|
That means that the code will be executed only 1 time.
ON used an internal variable - if i remember. . .
Long ago, some programs were written to say ON 1 AND EVERY 50 to control advancing a report to a new page and print the headers each time 50 more lines had been printed. ON was also useful for sampling rather than processing every record.
The things that could be done with ON were handled by defining a counter and controlling the process with a bit of actual code.
Long ago (mid-70's) many organizations limited the use of ON to a first-time switch (as your posted code does) for anything that was to be other than test. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Above has been edited for additional clarification. . .
d |
|
Back to top |
|
|
shankarm
Active User
Joined: 17 May 2010 Posts: 175 Location: India
|
|
|
|
dick scherrer,
Thanks for the response and your time.
I got the answer now. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
You're welcome - good luck
d |
|
Back to top |
|
|
|