View previous topic :: View next topic
|
Author |
Message |
madhand
New User
Joined: 04 May 2005 Posts: 10
|
|
|
|
Hi
I have a requirement to concatenate a field in which negative sign is imbedded.Ex.,the value for the field is 000-109.Negative sign can be in any of the 7 positions.So I have declared as PIC '(6)-9'. The various records are concatenated properly.But the issue is the leading zeros are suppressed.
It has to be retained in my requirement.
Please let me know.
Thanks
Madhan. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
What language? |
|
Back to top |
|
|
madhand
New User
Joined: 04 May 2005 Posts: 10
|
|
|
|
PL/1 |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
I'm guessing not doable, but I don't know PL/1....
Somebody who knows PL/1 will be along....... |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
What if you base a characterfield, use the builtin INDEX for '-', replace it with '0'? |
|
Back to top |
|
|
Srihari Gonugunta
Active User
Joined: 14 Sep 2007 Posts: 295 Location: Singapore
|
|
|
|
INDEX can only be used on Strings. I suppose CHAR(6) will serve the purpose of preserving the leading zeroes and the sign in the middle also... |
|
Back to top |
|
|
Bitneuker
CICS Moderator
Joined: 07 Nov 2005 Posts: 1104 Location: The Netherlands at Hole 19
|
|
|
|
Srihari Gonugunta wrote: |
INDEX can only be used on Strings. |
That's why I proposed to base a characterfield over it |
|
Back to top |
|
|
waneked
New User
Joined: 25 Sep 2007 Posts: 2 Location: switzerland
|
|
|
|
Hi
this reason works with the enterprise compiler
dcl cField char (07);
dcl aField pic'(4)-999';
cField = ' - 000';
aField = translate(trim(cField,' '),'0',' ');
put skip data (aField); |
|
Back to top |
|
|
|