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
 

 

Make last column in file space

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

New User


Joined: 20 Oct 2006
Posts: 29

PostPosted: Sat May 03, 2014 12:03 am    Post subject: Make last column in file space
Reply with quote

Hi,

I am having a file having variable length records and last byte of all records have one ',' which i want to make it 'Space'

For e.g:
rec 1: AQAAAAAA,Ashhsjk,jndfklsj,
rec 2: ahd,jsjk,djksljf,

The last byte of records are having ',' which i want to blank.
Let me know if its possible by any verb like string, inspect etc. or best possible method
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


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

PostPosted: Sat May 03, 2014 12:33 am    Post subject:
Reply with quote

It is not possible to do this with a single COBOL statement. However, with multiple COBOL statements it is easy. Use FUNCTION REVERSE to reverse the variable. Use INSPECT TALLYING LEADING SPACES to count the blanks until the first non-blank character. If the first non-blank character is a comma, use reference modification to change it. Use FUNCTION REVERSE to restore the variable.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Sat May 03, 2014 2:09 am    Post subject: Reply to: Make last column in file space
Reply with quote

If you use RECORD IS VARYING ... DEPENDING ON ... for your file, your depending-on value will indicate the length of the data.

You could then use that value as a subscript, or for the obfuscating reference-modification.
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 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
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am


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