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

deleting extra spaces


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 2146
Location: At my coffee table

PostPosted: Wed Sep 17, 2008 5:56 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Deleting a Tape file JCL & VSAM 14
No new posts leading spaces can be removed in trai... DFSORT/ICETOOL 1
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts Cobol program with sequence number ra... COBOL Programming 5
No new posts To Remove spaces (which is in hex for... JCL & VSAM 10
Search our Forums:

Back to Top