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
 
Inspecting \N

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

New User


Joined: 18 Aug 2008
Posts: 98
Location: India

PostPosted: Thu Oct 29, 2009 3:55 pm    Post subject: Inspecting \N
Reply with quote

hello

I am trying to INSPECT a string for \N. But its not working. Do I need to give some escape character for \. I tried searching in the cobol manual, has-nt come across the escape charcater.

I am getting a input string from c++ and \N is a new line character for them.

regards
Back to top
View user's profile Send private message

tomehta

New User


Joined: 18 Aug 2008
Posts: 98
Location: India

PostPosted: Thu Oct 29, 2009 4:27 pm    Post subject: Reply to: Inspecting \N
Reply with quote

I uses \\N for INSPECT, and it worked. When we are using \\N, cobol is looking for \N, i guess \ is the escape charcter...
please correct me if I am wrong.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Oct 29, 2009 5:32 pm    Post subject:
Reply with quote

Hi Mehta,

Could you give us the example of what you have tried.

Up until now i was not aware of any escape characters in COBOL except for Quotation Marks... icon_razz.gif
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Thu Oct 29, 2009 5:41 pm    Post subject:
Reply with quote

Hi,

A sample that I tried now...

Code:
MOVE 'ABC\NXYZ' TO WS-WORK1               
DISPLAY WS-WORK1                           
INSPECT WS-WORK1 REPLACING ALL '\N' BY '$$'
DISPLAY WS-WORK1                           
Output
Code:
ABC\NXYZ
ABC$$XYZ


Is this what you have tried ?? or something else ?? icon_cool.gif
Please explain...
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8189
Location: East Dubuque, Illinois, USA

PostPosted: Thu Oct 29, 2009 5:48 pm    Post subject:
Reply with quote

Quote:
I uses \\N for INSPECT, and it worked. When we are using \\N, cobol is looking for \N, i guess \ is the escape charcter...
please correct me if I am wrong.
I did a test of INSPECT finding '\N' and it returned the correct count. COBOL does not have an escape character -- if you look in the COBOL Language Reference glossary (manuals link at the top of the page), the term is not defined even.
Back to top
View user's profile Send private message
tomehta

New User


Joined: 18 Aug 2008
Posts: 98
Location: India

PostPosted: Thu Oct 29, 2009 5:57 pm    Post subject: Reply to: Inspecting \N
Reply with quote

Code:
        MOVE LENGTH OF WS-SRCH-STRING TO WS-SRCH-STRING-       
                                                                   
           INSPECT WS-SRCH-STRING TALLYING WS-SRCH-TAG-B-L FOR     
                    CHARACTERS BEFORE INITIAL 'STMTEND\N#X#'       
00000455  MC-02/08 INVALID PARAMETER ->N#<-                       


This is when I tried with \N .. the code was not able to compiled.
Wehn i used \\N it went fine.

my shop is using a DLETA precompiler, i am sure the error is from delta precompiler and not from the cobol compiler.
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 Inspecting a record for all alphabets Robert Sample COBOL Programming 6 Thu May 20, 2010 4:45 pm
No new posts Inspecting a phrase and replacing bamohan COBOL Programming 3 Tue Mar 24, 2009 8:46 am

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