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

Query regarding Declaration


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

New User


Joined: 04 May 2005
Posts: 10

PostPosted: Mon Sep 10, 2007 1:52 pm
Reply with quote

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

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 3:22 pm
Reply with quote

What language?
Back to top
View user's profile Send private message
madhand

New User


Joined: 04 May 2005
Posts: 10

PostPosted: Mon Sep 10, 2007 3:43 pm
Reply with quote

PL/1
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 3:45 pm
Reply with quote

I'm guessing not doable, but I don't know PL/1....
Somebody who knows PL/1 will be along.......
Back to top
View user's profile Send private message
Bitneuker

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Sun Sep 23, 2007 9:12 pm
Reply with quote

What if you base a characterfield, use the builtin INDEX for '-', replace it with '0'?
Back to top
View user's profile Send private message
Srihari Gonugunta

Active User


Joined: 14 Sep 2007
Posts: 295
Location: Singapore

PostPosted: Mon Sep 24, 2007 10:14 am
Reply with quote

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

CICS Moderator


Joined: 07 Nov 2005
Posts: 1104
Location: The Netherlands at Hole 19

PostPosted: Mon Sep 24, 2007 4:24 pm
Reply with quote

Srihari Gonugunta wrote:
INDEX can only be used on Strings.


That's why I proposed to base a characterfield over it icon_idea.gif
Back to top
View user's profile Send private message
waneked

New User


Joined: 25 Sep 2007
Posts: 2
Location: switzerland

PostPosted: Thu Sep 27, 2007 2:20 pm
Reply with quote

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
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 RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top