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: 7989
Location: Bellevue, IA

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: 7989
Location: Bellevue, IA

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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 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 TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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