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
 

 

Initialize the tally counter IN INSPECT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2276
Location: @my desk

PostPosted: Tue Nov 21, 2006 6:40 pm    Post subject: Initialize the tally counter IN INSPECT
Reply with quote

Is it compulsory to initialize the tally counter used along with the INSPECT TALLYING option?If the counter is left uninitialized I am getting SOC7error.
What could be the reason?

Thanks
Arun
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Nov 21, 2006 6:53 pm    Post subject:
Reply with quote

From the fine manual:
identifier-2 Is the count field, and must be an elementary integer item defined without the symbol P in its PICTURE character-string. identifier-2 cannot be an external floating-point item. You must initialize identifier-2 before execution of the INSPECT statement begins.
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Wed Nov 22, 2006 2:10 pm    Post subject:
Reply with quote

The counter must be initialized because when each inspect takes place
the internal operation is
COUNT = COUNT + 1
ie when each character that we specified founds in the inspecting identifier the internal operation of count increment takes place
so if we left COUNTER uninitialized the calculation will result in abend because there may be some junk values in COUNTER that are not numeric
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:

Similar Topics
Topic Author Forum Replies Posted
No new posts Inspect statement spoorni COBOL Programming 5 Mon Jun 06, 2016 9:53 pm
No new posts Using Inspect in cobol Ajay Dwivedi COBOL Programming 8 Sat Sep 26, 2015 11:33 pm
No new posts EQUIVALENT OF COBOL INSPECT IN REXX pshongal CLIST & REXX 2 Fri Nov 22, 2013 10:44 am
No new posts Need to Initialize an empty flat file... ksouren007 DFSORT/ICETOOL 9 Fri Sep 27, 2013 6:57 pm
No new posts How to initialize address location in... Pavankumar.m COBOL Programming 2 Thu Sep 05, 2013 12:58 pm


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