Thank you Barbara,
Is there some short cut to creating the non-print characters constant, by my calculations the string based on your start there would be about 320 characters long.
Thanks & Regards,
Danny Hayes
IT-Developer
Genuine Parts Company, APG IT
3100 Windy Hill Road
Atlanta, Georgia 30339
mailto:Danny_Hayes@xxxxxxxxx
(904) 502-2969
"People will forget what you said, people will forget what you did, but people will never forget how you made them feel." - Maya Angelou
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Barbara Morris
Sent: Wednesday, April 24, 2019 1:00 PM
To: rpg400-l@xxxxxxxxxxxxxxxxxx
Subject: [EXT] Re: %SCANREPL non-print chars
On 2019-04-24 10:40 AM, Danny Hayes wrote:
I want to use %SCANRPL to replace all non-print characters in a string.
If you want to replace them all with the same character, use %XLATE.
If you want to remove them, then first use %XLATE to change all the non-print characters to one of the non-print characters, and then use %SCANRPL to remove them.
dcl-c nonprint_chars x'00010203...';
dcl-s all_same_nonprint_char char(%size(nonprint_chars))
inz(*allx'01');
dcl-c one_nonprint_char x'01';
string = %XLATE(nonprint_chars : all_same_non_print_char : string);
string = %SCANRPL (one_nonprint_char : '' : string);
--
Barbara
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Frpg400-l&data=02%7C01%7Cdanny_hayes%40genpt.com%7C2191c2607c8e439df62a08d6c8d6683b%7Cb439d764f2cb43eaac052e373c83043e%7C0%7C0%7C636917220537006491&sdata=NGzrxcX4fYyqC09HadizKYbOniNYG7a3dcOdepfcyII%3D&reserved=0
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Frpg400-l&data=02%7C01%7Cdanny_hayes%40genpt.com%7C2191c2607c8e439df62a08d6c8d6683b%7Cb439d764f2cb43eaac052e373c83043e%7C0%7C0%7C636917220537006491&sdata=qHbQcs%2B8FbKJGAIC95AJagPZln20jmcLa%2FbfYKgYf8c%3D&reserved=0.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Famazon.midrange.com&data=02%7C01%7Cdanny_hayes%40genpt.com%7C2191c2607c8e439df62a08d6c8d6683b%7Cb439d764f2cb43eaac052e373c83043e%7C0%7C0%7C636917220537006491&sdata=B%2Be91Gl97FQHhXY3uf8cNdOW5IIoQvW8kxgfz%2Fxjd5w%3D&reserved=0
"This email and any attachments, contain Genuine Parts Company confidential information that is proprietary, privileged, and protected by applicable laws. If you have received this message in error and are not the intended recipient, you should not retain, distribute, disclose or use any of this information and you should destroy this email, any attachments or copies therein forthwith. Please notify the sender immediately by email if you have received this email in error."
As an Amazon Associate we earn from qualifying purchases.