View previous topic :: View next topic
|
Author |
Message |
Ali_gezer
Active User
Joined: 06 Apr 2021 Posts: 123 Location: argentina
|
|
|
|
Hello to all.
How to remove spaces within a string in COBOL, and for each space removed, replace it with the string XXXX. That is, the characters to the right of the removed space should be retained, they just need to be moved to the right.
my requirement is:
original string
changed string
do you have any clue? in jcl I can use Outrec and insert the substring but in cobol I did not reach the desire result yet.
Thanks
Code'd for you |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1306 Location: Bamberg, Germany
|
|
|
|
Ali_gezer wrote: |
in jcl I can use Outrec and insert the substring but in cobol I did not reach the desire result yet. |
JCL does not have an OUTREC keyword. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
My turn to say: With 123 posts starting 3 years ago, you must know by now that no one is going to help you until you post (using code tags) your attempted solution, along with the input and output from your latest test. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3075 Location: NYC,USA
|
|
|
|
You can use reference modification in COBOL.. move one by one byte to output field and once you hit the space move hardcoded 'xxxx' and continue to advance one byte to move to output field until end of record.
Does this hint help? |
|
Back to top |
|
|
|