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

VB File handling with suppression of spaces


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 13, 2009 5:39 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Fri Mar 13, 2009 7:05 pm
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: 2146
Location: At my coffee table

PostPosted: Fri Mar 13, 2009 7:12 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top