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
 

 

VB File handling with suppression of spaces

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

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Fri Mar 13, 2009 5:08 pm    Post subject: VB File handling with suppression of spaces
Reply with quote

We have a case where input file records are having spaces at the end. Each record is of different length. Our requirement is to suppress the spaces at the end & write to the output file.
Let say Input file is having records like –
ABC ABC DEF FGH____
ABC DFG GHJK SHAG FHGJ____
FDSJKDHFKJS____
DKSAUDHKASD______

Out put required is –
ABC ABC DEF FGH
ABC DFG GHJK SHAG FHGJ
FDSJKDHFKJS
DKSAUDHKASD

Record length is defined at 580 bytes for output. Going by requirement it should have different record length for each record. We are not sure how many records would be there in the input file & hence can’t defined any specific layout for this. Can anyone suggest how this could be handled in cobol?

Thanks in advance
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Fri Mar 13, 2009 5:39 pm    Post subject:
Reply with quote

Use the RECORD CONTAINS clause on the input FD to find out how long the record is; count back to find the first non-blank character and move the appropriate number of characters to the output FD 01 which also needs the RECORD CONTAINS clause.
Back to top
View user's profile Send private message
shell100

New User


Joined: 14 Apr 2006
Posts: 25
Location: Banglore,India

PostPosted: Fri Mar 13, 2009 6:31 pm    Post subject: Reply to: VB File handling with suppression of spaces
Reply with quote

It would be great if you could elaborate little bit on the solution provided.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


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

PostPosted: Fri Mar 13, 2009 7:05 pm    Post subject:
Reply with quote

Elaborate in what way? I've given you the clauses to use (the manuals link at the top of the page will give you details if you're not familiar with them already), as well as the logic required. If there's anything you don't understand then give more details.

If you're wanting actual code, I'm willing to discuss my fee for it -- but otherwise this is a help forum, not a do-it-for-you forum.
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: Fri Mar 13, 2009 7:12 pm    Post subject: Re: Reply to: VB File handling with suppression of spaces
Reply with quote

shell100 wrote:
It would be great if you could elaborate little bit on the solution provided.
It would be great if you could elaborate a bit on the requirement.
Records are variable length, not fixed?
The 580 is max length for output of the variable records?
The only thing you want suppressed is the trailing spaces at the end of the record?
There are no other fields in a record that need the spaces suppressed?
The suppressing of the trailing spaces will be accomplished by writing the output record with a shorter length than the input?
Is this thread related to Suppression of trailing spaces in given string?
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 Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am


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