Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Right Justified in PLI

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
notonly4u

New User


Joined: 26 Apr 2005
Posts: 87
Location: Hyderabad

PostPosted: Wed Feb 09, 2011 11:40 am    Post subject: Right Justified in PLI
Reply with quote

Friends,

Can anyone let me know, how can we justify a character field to right?
In cobol we have a JUST RIGHT. Likewise do we have something in PLI?

The compiler in my shop is not allowing the built-in function RIGHT icon_sad.gif
Pls advise.

Regards
Tanden
Back to top
View user's profile Send private message

prino

Senior Member


Joined: 07 Feb 2009
Posts: 1002
Location: Oostende, Belgium

PostPosted: Wed Feb 09, 2011 4:24 pm    Post subject: Re: Right Justified in PLI
Reply with quote

notonly4u wrote:
Can anyone let me know, how can we justify a character field to right? In cobol we have a JUST RIGHT. Likewise do we have something in PLI?

The compiler in my shop is not allowing the built-in function RIGHT icon_sad.gif
Pls advise.


Tell us what version of the compiler you are using!
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1753
Location: Bloomington, IL

PostPosted: Thu Feb 10, 2011 12:28 am    Post subject: Re: Right Justified in PLI
Reply with quote

notonly4u wrote:
Friends,

Can anyone let me know, how can we justify a character field to right?
In cobol we have a JUST RIGHT. Likewise do we have something in PLI?

The compiler in my shop is not allowing the built-in function RIGHT icon_sad.gif
Pls advise.

Tested, but all error checking omitted:
Code:
dexter: proc (x, n, z) returns (pointer);         
dcl x                              char (*),     
    n                              fixed bin (31),
    z                              char;         
dcl (l1, l2)                       fixed bin (31),
    work                           char (n);     
                                                 
l1   = length(x);                                 
l2   = verifyr(x, ' ');                           
work = copy(' ', n-l1) || substr(x,1,l2);         
return (addr(work));                             
end dexter;                                       
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How move left justified space filled ... dick scherrer COBOL Programming 3 Fri Jan 07, 2011 10:25 pm
No new posts How can i display my string with just... padmavathi COBOL Programming 2 Thu May 08, 2008 1:24 pm
No new posts adding right justified fields through... rohitcognizant DFSORT/ICETOOL 8 Mon Oct 08, 2007 3:07 pm
No new posts Move a stringed data to a table filed... vin12pr COBOL Programming 6 Wed May 30, 2007 9:02 pm
No new posts Move the fields to left justified usi... William Thompson DFSORT/ICETOOL 4 Thu Feb 15, 2007 7:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us