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

Post your questions on PL/I.

Moderator: Moderator Group

Post Reply
Posts: 20
Joined: Thu Aug 28, 2008 10:41 am

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

Post by biswaranjan » Thu Feb 11, 2010 9:35 am


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.


Posts: 12
Joined: Wed Jun 18, 2008 1:36 pm

Post by MikeJ024 » Fri Mar 05, 2010 3:13 am

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.

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others