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
 

 

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 Join in SQL Query vickey_dw DB2 2 Tue Jan 17, 2017 12:15 am
This topic is locked: you cannot edit posts or make replies. MQ setup query mohitsaini Java & MQSeries 4 Sun Jan 08, 2017 1:53 am
No new posts DB2 query Using Recursion, Converting... smilewithashu2 DB2 1 Tue Jan 03, 2017 12:50 pm
No new posts SQL query to run through list of valu... Ni3-db2 DB2 14 Wed Dec 14, 2016 9:52 am
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm


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