Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Left Alignment in PL/1.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER
Author Message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Fri Jun 27, 2008 4:46 pm    Post subject: Left Alignment in PL/1.
Reply with quote

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
View user's profile Send private message
References
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 186
Location: Pune

PostPosted: Fri Jun 27, 2008 5:42 pm    Post subject:
Reply with quote

Redefine your variable on a char and use LEFT function on char variable.
Back to top
View user's profile Send private message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Fri Jun 27, 2008 5:47 pm    Post subject: Left Alignment in PL/1.
Reply with quote

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
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 186
Location: Pune

PostPosted: Fri Jun 27, 2008 6:26 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Tue Jul 01, 2008 3:55 pm    Post subject: Left Alignment in PL/1.
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & ASSEMBLER All times are GMT + 6 Hours
Page 1 of 1