Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Query regarding Declaration

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: Query regarding Declaration
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: 2150
Location: At my coffee table

PostPosted: Mon Sep 10, 2007 3:22 pm    Post subject:
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    Post subject:
Reply with quote

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

Senior Member


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

PostPosted: Mon Sep 10, 2007 3:45 pm    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Sun Sep 23, 2007 9:12 pm    Post subject:
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    Post subject:
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: 1105
Location: The Netherlands at Hole 19

PostPosted: Mon Sep 24, 2007 4:24 pm    Post subject:
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    Post subject:
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    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 HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm
No new posts Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am
No new posts Need DB2 query to fetch previous row ! Chandan1993 DB2 10 Sat Jun 03, 2017 10:43 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us