|
|
| Author |
Message |
Ashokn
New User
Joined: 25 Jun 2008 Posts: 8 Location: Bangalooru
|
|
|
|
Hi,
How can I format PIC '999V.99' to left align it in pl/1 ?
for ex: "bbbbb123.45" (b=blank). I want it without blanks & it should be left-aligned.
Please give me the solution.
Ashok. |
|
| Back to top |
|
 |
References
|
Posted: Fri Jun 27, 2008 4:46 pm Post subject: Re: Left Alignment in PL/1. |
 |
|
|
 |
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 154 Location: Pune
|
|
|
|
| Redefine your variable on a char and use LEFT function on char variable. |
|
| Back to top |
|
 |
Ashokn
New User
Joined: 25 Jun 2008 Posts: 8 Location: Bangalooru
|
|
|
|
Hi,
DCL LFTALN PIC 'bbbbb123.45'
pls make changes to above statement & how to use LEFT function.Please give me full syntax.
=============================================
| Srihari Gonugunta wrote: |
| Redefine your variable on a char and use LEFT function on char variable. |
|
|
| Back to top |
|
 |
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 154 Location: Pune
|
|
|
|
DCL LFTCHR CHAR(11);
DCL LFTALN PIC 'ZZZZZ999V.99' BASED(ADDR(LFTCHR));
LFTALN=123.45;
LFTCHR=TRIM(LFTCHR,' ');
PUT SKIP LIST('LFTCHR : ',LFTCHR);
Hope this helps |
|
| Back to top |
|
 |
Ashokn
New User
Joined: 25 Jun 2008 Posts: 8 Location: Bangalooru
|
|
|
|
Hello Sir,
I compiled below PL/1 program(of LeftAlign) but I'm getting below error:
ERROR 1 SEVERITY 3 on or near line 3 of file "test.wrk"
The source text contains extraneous data. Check for excess
END statements, unbalanced quotes, and unbalanced /* */.===========================================
| Srihari Gonugunta wrote: |
DCL LFTCHR CHAR(11);
DCL LFTALN PIC 'ZZZZZ999V.99' BASED(ADDR(LFTCHR));
LFTALN=123.45;
LFTCHR=TRIM(LFTCHR,' ');
PUT SKIP LIST('LFTCHR : ',LFTCHR);
Hope this helps |
|
|
| Back to top |
|
 |
|
|