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

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: 7306

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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 1 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
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


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