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

'ON' - REG


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Thu Jul 15, 2010 2:57 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 15, 2010 3:38 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 15, 2010 4:26 am
Reply with quote

Above has been edited for additional clarification. . .

d
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Thu Jul 15, 2010 4:07 pm
Reply with quote

dick scherrer,

Thanks for the response and your time. icon_biggrin.gif
I got the answer now.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 15, 2010 9:21 pm
Reply with quote

You're welcome - good luck icon_smile.gif

d
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 -> COBOL Programming

 


Search our Forums:

Back to Top