View previous topic :: View next topic
|
Author |
Message |
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
Hi
can any body explain me how to do padding in ispf panel. I want the last unfilled bytes of the variable field of my panel to be padded with spaces.
Ex: i have two fields name(15) and city(10) and if user entres the like this:
name : james bond(i.e. 9 + 1 space in between=10 chars)
city : london
then I want output like:
"james bond5spaceslondon4spaces"i.e. total 25 chars
and not like :
"james bondlondon" |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
Use PAD(' ') in your attributes section.
O. |
|
Back to top |
|
|
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
Ofer
I checked with PAD(' '). But it is not working
still I am getting the vlues entered as conncatnating with previous field's values. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
When you specify PAD('_'), you can see the underscores in the panel but you don't receive them in the variables.
Similarly, with PAD(' ') you will "see" the spaces but won't receive them.
In the rexx that displays the panel, I would do:
Code: |
OutData = Left(name,15)||Left(city,10) |
|
|
Back to top |
|
|
prashantshinde
New User
Joined: 25 Nov 2005 Posts: 49 Location: Pune
|
|
|
|
Marso
YOu got it right. I can see spaces or '_' in the panel but do not get it in variable's output values. And I want same thing , in the variable's output.
Please give me suggestion for CLIST only as I am not using REXX.
Thanks. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
I have found another way. In the panel:
Code: |
)PROC
&name = '&name. ' add 15 spaces after whatever was entered in the name field
&name = trunc(&name,15) cut all the extra spaces on the right to reach a size of 15
&city = '&city. ' add 10 spaces after whatever was entered in the city field
&city = trunc(&city,10) cut all the extra spaces on the right to reach a size of 10
|
|
|
Back to top |
|
|
|