Hi,
I want to remove leading spaces from a veriable.In PL1 how I can do that?
Ex: A= ' A BC'
I want O/P as 'A BC'
Regards
Biswa.
Removing leading spaces from veriable
Moderator: Moderator Group
-
- Member
- Posts: 20
- Joined: Thu Aug 28, 2008 10:41 am
hi,
you can use the substr builtin function to do this as follows using your example above:
a = substr(a,2,4);
substr(variable,starting pos, length)
if you have a variable # of leading spaces add the verify fuction as follows:
a = substr(a,verify(a,' '),4) this will find the first nonblank char.
hope this helps
MikeJ024
you can use the substr builtin function to do this as follows using your example above:
a = substr(a,2,4);
substr(variable,starting pos, length)
if you have a variable # of leading spaces add the verify fuction as follows:
a = substr(a,verify(a,' '),4) this will find the first nonblank char.
hope this helps
MikeJ024
-
- Member
- Posts: 20
- Joined: Thu Aug 28, 2008 10:41 am
If you are using Enterprise PL/1 for z/OS, you may have a look to the TRIM builtin function.MikeJ024 wrote:hi,
you can use the substr builtin function to do this as follows using your example above:
a = substr(a,2,4);
substr(variable,starting pos, length)
if you have a variable # of leading spaces add the verify fuction as follows:
a = substr(a,verify(a,' '),4) this will find the first nonblank char.
hope this helps
MikeJ024
Best Regards:
Jochen Schmitt
FREE TUTORIALS
Tutorials
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.
Interview
Mainframe Interview questions
- Cobol Interview Questions
50+ Interview Questions - JCL Interview Questions
50+ Interview Questions - DB2 Interview Questions
100+ Interview Questions - CICS Interview Questions
70+ Interview Questions - VSAM Interview Questions
27 Interview Questions
Other References
Mainframe Tools and others
- XPEDITER Reference
Explains how we can debug a program - FILEAID Reference
Explains how to browse , edit and delete datasets - Change Man Reference
Quick Start tutorial on Changeman - Abend Reference
Important Abend codes explained - FaceBook Page
MainframeGurukul FaceBook Page - LinkedIn Page
MainframeGurkul Linkedin Page