IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Left Alignment in PL/1.


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Ashokn

New User


Joined: 25 Jun 2008
Posts: 13
Location: Bangalooru

PostPosted: Fri Jun 27, 2008 4:46 pm
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
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Fri Jun 27, 2008 5:42 pm
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
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: 295
Location: Singapore

PostPosted: Fri Jun 27, 2008 6:26 pm
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
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts Squeeze record left so that zeroes ar... SYNCSORT 5
No new posts Coverting PD to FS and also left just... DFSORT/ICETOOL 6
No new posts Zero suppress and shift left DFSORT/ICETOOL 10
No new posts Mailing PS dataset - Improper Alignme... JCL & VSAM 10
Search our Forums:

Back to Top