Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mask the string with # using cobol

Status
Not open for further replies.

Pujitha Reddy

Programmer
Dec 29, 2020
1
IN

MASK the string with #

WS01-NAME PIX CHAR(18)
WS02-NAME-CNT PIX 9(2)

EG:
WS01-NAME="UNIVER SE"
In middle of the name string contain space ,Here i need to mask the entire string with "#"
INSPECT WS01-NAME TALLYING WS02-NAME-CNT
FOR CHARACTERS
REPLACING CHARACTERS by "#" BEFORE INITIAL ' '.
OUTPUT:###### SE
EXPECTED output :#########

is any alternative way using INSPECT verb or other logic ?
 
My usual 'trick' is to use multiple spaces in the BEFORE INITIAL clause
Code:
... BEFORE INITIAL '  '
or
Code:
... BEFORE INITIAL '   '


Tom Morrison
Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top