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

Regarding Inspect


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

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Fri Oct 10, 2008 11:35 pm
Reply with quote

Hi Dick,
The solution that I had provided would find out the number of occurances of two consecutive ' (single code). This is the requirement right!!!! Correct me if Iam wrong.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Fri Oct 10, 2008 11:39 pm
Reply with quote

Krishna,
Please use BBCode to preserve accurate spacing. See FAQ.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Sat Oct 11, 2008 12:48 am
Reply with quote

what is wrong with definining a variable PIC X(02) value ''''. ?
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: Sat Oct 11, 2008 1:48 am
Reply with quote

Hello,

Quote:
This is the requirement right!!!!
Yup, sure is icon_smile.gif

The "string" of quotes did not equate to one pair of consecutive single-quotes to my (easily confused) mind icon_redface.gif

When i've needed to use one or more quotes as a data value, i've put something in ws (like dbz recommended or with the value QUOTE), or i've used the hex value inline.
Back to top
View user's profile Send private message
Krishna Velamur

New User


Joined: 22 Aug 2008
Posts: 22
Location: Hyderabad

PostPosted: Mon Oct 13, 2008 11:16 am
Reply with quote

Hi Dick,
It was a mistake from my side. Actually I moved the string of quotes into STR-2 which was defined as X(02). Thats the reason why my code was working. As suggested by Dick B, we can move " '' " into a string and use in inspect.


Ex:
Code:
STR-2 PIC X(02) VALUE "''".
INSPECT STR-1 TALLYING W-CNT FOR ALL STR-2


or we can use

Code:
 
INSPECT STR-1 TALLYING W-CNT FOR ALL ''''''



Hope this helps. Corrections are welcome.
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 Inspect in Assemebler PL/I & Assembler 10
No new posts Help needed with INSPECT COBOL Programming 3
No new posts Inspect statement COBOL Programming 5
No new posts Using Inspect in cobol COBOL Programming 8
No new posts EQUIVALENT OF COBOL INSPECT IN REXX CLIST & REXX 2
Search our Forums:

Back to Top