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
 

 

deleting extra spaces

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

New User


Joined: 16 Sep 2008
Posts: 6
Location: india

PostPosted: Wed Sep 17, 2008 5:34 pm    Post subject: deleting extra spaces
Reply with quote

I have a file which unfortunately does not have a fixed record format..

Code:
xxxxxxx       yyyyyyyyyyyyy
xxx  yyyyyyyy

xxxxxxxxxxxxxx            yyyyyyyyyyyyyyy


As you can see from the above example ... there are two fields and the length of the fields are not uniform. they are seperated by spaces but even the number of spaces between them is not the same among he records...


Altough i am able to extract the first string by using delimited by space .. i have no idea asto how i can remove the extra spaces that lie before the second field ..
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Wed Sep 17, 2008 5:56 pm    Post subject: Re: deleting extra spaces
Reply with quote

kevinsamuel.abraham wrote:
Altough i am able to extract the first string by using delimited by space .. i have no idea asto how i can remove the extra spaces that lie before the second field ..

DELIMITED BY ALL
One or more contiguous occurrences of any delimiters are treated as if they were only one occurrence; this one occurrence is moved to the delimiter receiving field (identifier-5), if specified. The delimiting characters in the sending field are treated as an elementary item of the same usage and category as identifier-1 and are moved into the current delimiter receiving field according to the rules of the MOVE statement.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Wed Sep 17, 2008 5:56 pm    Post subject:
Reply with quote

This TOPIC might help you.
Back to top
View user's profile Send private message
kevinsamuel.abraham

New User


Joined: 16 Sep 2008
Posts: 6
Location: india

PostPosted: Wed Sep 17, 2008 5:58 pm    Post subject: Reply to: deleting extra spaces
Reply with quote

Thank you guys ...

Thi should solve my problem ..

Cheers - kev
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 Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm


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