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
 

 

New line character in char field

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

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Fri Jul 20, 2007 1:05 pm    Post subject: New line character in char field
Reply with quote

Hi,

My input field is FLDA and output field is FLDB. In my program i'm having

MOVE FLDA TO FLDB. My field FLDA has a hex value of X'15' which is a new line charater. How can i eliminate this character. I'm initializing the output file before move. And after move i'm inspecting for low-values and high-values. What to do for this X'15'.?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Fri Jul 20, 2007 2:14 pm    Post subject:
Reply with quote

Do you want it replaced with a blank?
Or do you want it (and the character position it occupies) squeezed out?
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Fri Jul 20, 2007 2:30 pm    Post subject: Re: New line character in char field
Reply with quote

I want it to be as spaces...
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Jul 20, 2007 2:38 pm    Post subject:
Reply with quote

Hi Selva,

You can code this

Code:
IF FLDA = X'15'
    MOVE SPACES TO FLDA
ELSE
    CONTINUE
END-IF.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jul 20, 2007 2:42 pm    Post subject:
Reply with quote

Have you looked at various options available in the COBOL reference manual? The inspect verb?
Back to top
View user's profile Send private message
Selva-kumar

New User


Joined: 01 Mar 2007
Posts: 52
Location: chennai

PostPosted: Fri Jul 20, 2007 2:54 pm    Post subject: Re: New line character in char field
Reply with quote

Hi kgumraj,

I can do that if condition. But my input file has 300 fields and i don't know in which field it can occur? So how can i check as a overall?
Back to top
View user's profile Send private message
kgumraj

Active User


Joined: 01 May 2006
Posts: 151
Location: Hyderabad

PostPosted: Fri Jul 20, 2007 3:23 pm    Post subject:
Reply with quote

Check this logic

MOVE FUNCTION LENGTH (FLDA) TO WS-VAR.

PERFORM VARYING J-IND FROM 1 BY 1 UNTIL J-IND > 15
IF FLDA(J-IND:1) = X'15'
MOVE SPACES TO FLDA
ELSE
CONTINUE
END-IF
END-PERFORM.

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

Global Moderator


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

PostPosted: Fri Jul 20, 2007 3:53 pm    Post subject:
Reply with quote

Kiran, did you mean:

MOVE FUNCTION LENGTH (FLDA) TO WS-VAR.

PERFORM VARYING J-IND FROM 1 BY 1 UNTIL J-IND > WS-VAR
IF FLDA(J-IND:1) = X'15'
MOVE SPACES TO FLDA(J-IND:1)
ELSE
CONTINUE
END-IF
END-PERFORM.
Back to top
View user's profile Send private message
stodolas

Active Member


Joined: 13 Jun 2007
Posts: 632
Location: Wisconsin

PostPosted: Fri Jul 20, 2007 9:06 pm    Post subject:
Reply with quote

Either way that is horrible can't you just do an INSPECT FLDA replaceing x'15' by x'40'
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: Fri Jul 20, 2007 10:26 pm    Post subject:
Reply with quote

Hello,

Just to add a bit to
Quote:
Either way that is horrible can't you just do an INSPECT FLDA replaceing x'15' by x'40'

If FLDA is not the group/record, create a group that contains all of the fields that need to have the x'15' replaced.
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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am


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