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

Initialize the tally counter IN INSPECT


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

Moderator


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

PostPosted: Tue Nov 21, 2006 6:40 pm
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: 3156
Location: Tucson AZ

PostPosted: Tue Nov 21, 2006 6:53 pm
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: 127
Location: kerala,india

PostPosted: Wed Nov 22, 2006 2:10 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
No new posts Sort counter to show records combination JCL & VSAM 2
No new posts Add a step counter in a stack ? CLIST & REXX 23
No new posts Inspect in Assemebler PL/I & Assembler 10
No new posts Setting up a name counter in the coup... CICS 2
Search our Forums:

Back to Top