Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
'ON' - REG

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: 'ON' - REG
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

Site Director


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

PostPosted: Thu Jul 15, 2010 3:38 am    Post subject:
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

Site Director


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

PostPosted: Thu Jul 15, 2010 4:26 am    Post subject: Reply to: 'ON' - REG
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    Post subject:
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

Site Director


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

PostPosted: Thu Jul 15, 2010 9:21 pm    Post subject: Reply to: 'ON' - REG
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:


Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us