Page 1 of 1

How to assign NULL to a veriable throgh TRANSLATE in PL/I

Posted: Thu Feb 11, 2010 9:35 am
by biswaranjan

I want to replace value of a particular column with a NULL character, not space.

A = 50?th Anniversary.

B = TRANSLATE(A,'','?'); is converting the O/P as "50 th Anniversary".
A space is being inserted.

Output I want as A = 50th Anniversary
No space inbetween 50 and th.

Please guide me on this and let me know how to acheive it in TRANSLATE command.


Posted: Fri Mar 05, 2010 3:13 am
by MikeJ024
hi, can't be done with the translate command as translate only does a 1 to 1 replacement. However you can fix it with the SUBSTR parm as follows:
A = SUBSTR(A,1,2)||SUBSTR(A,4,14); this will delete the 'not' symbol out of the variable. Hope this helps.