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
 

 

PLI:A strange thing(difference between pic'-9'&pic'99')

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
Liang Gao

New User


Joined: 22 Mar 2012
Posts: 6
Location: china

PostPosted: Thu Apr 26, 2012 12:55 pm    Post subject: PLI:A strange thing(difference between pic'-9'&pic'99')
Reply with quote

PLI CODE:
Code:
EV63TS01:PROC OPTIONS(MAIN);                       
  DCL SPKKYIF        FILE INPUT  RECORD;           
  DCL QTFAZ     PIC'ZZZV.ZZ-';                     
  DCL 1 IN_SPKKYIF   ,                             
        2 IN_FILLER1   CHAR(261),                   
        2 DUABD9       PIC'99',                     
        2 IN_FILLER2   CHAR(27);                   
  OPEN FILE(SPKKYIF);                               
  READ FILE(SPKKYIF) INTO(IN_SPKKYIF);             
  PUT SKIP LIST('IN_DUABD9 = '||IN_SPKKYIF.DUABD9);
  QTFAZ       = IN_SPKKYIF.DUABD9;                 
  PUT SKIP LIST('OT_QTFAZ  = '||QTFAZ);             
   CLOSE FILE(SPKKYIF);                             
END EV63TS01;                                       


In the SPKKYIF file.the DUABD9 is 112

RUN1: With the code above.and
Code:
2 DUABD9       PIC'99', 

JOBLOG1:
Code:
*******************
IN_DUABD9 = 12     
OT_QTFAZ  =  12.00
*******************


RUN2: CHANGE the PIC'99' TO PIC'-9'.LIKE BELOW
Code:
2 DUABD9       PIC'-9', 

JOBLOG2:
Code:
********************
IN_DUABD9 = 12     
OT_QTFAZ  =   2.00 
********************


STRANGE:
the two time ,we both read value of the DUABD9 from the input file.
and get the same value 12 .
but when we move the value to QTFAZ.we get the different result.

Q/A:
1.do you think is there some wrong with the compiler.
2.what's the reason about this thing.

if there is anything that is diffcult to read the page.please connect me.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7306

PostPosted: Thu Apr 26, 2012 1:46 pm    Post subject: Reply to: PLI:A strange thing(difference between pic'-9'&
Reply with quote

I don't know PL/I, but why don't you look in the manual and see whether the "-" always takes a byte, so what you have defined is a field which can contain -9 through 9. Then, when you try to set it to a value with two or more digits after the leading zeros, you'll get truncation.

No compiler error. It is what you have asked the compiler to do.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1002
Location: Oostende, Belgium

PostPosted: Thu Apr 26, 2012 1:54 pm    Post subject:
Reply with quote

Now why would there be anything wrong with the compiler, a compiler that has been around since somewhere in the mid 1960'ies? If there was something wrong, it would have been solved about 45 years ago.

Learn about the PIC format and how it is moved from one PIC to another PIC, try putting '!!' in the input file, and then come back to us. (Hint: Compile you program with OPT(0),LIST and look at the generated code)
Back to top
View user's profile Send private message
senthilnathanj

New User


Joined: 31 Jul 2007
Posts: 47
Location: chennai

PostPosted: Thu Apr 26, 2012 4:50 pm    Post subject: Reply to: PLI:A strange thing(difference between pic'-9'&
Reply with quote

Hi,
Here Z denotes a zero suppression Characters. It specifies a conditional digit position and causes a leading zero in the associated data position to be replaced by a blank. Otherwise, the digit in the position is unchanged. The picture character Z cannot appear in the same field as the picture character * or a drifting character, nor can it appear to the right of any of the picture characters in a field.

Please let me know..
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1002
Location: Oostende, Belgium

PostPosted: Thu Apr 26, 2012 8:42 pm    Post subject: Re: Reply to: PLI:A strange thing(difference between pic'-9'
Reply with quote

senthilnathanj wrote:
Hi,
Here Z denotes a zero suppression Characters. It specifies a conditional digit position and causes a leading zero in the associated data position to be replaced by a blank. Otherwise, the digit in the position is unchanged. The picture character Z cannot appear in the same field as the picture character * or a drifting character, nor can it appear to the right of any of the picture characters in a field.

Please let me know..

What should we let you know? That you can copy text from a manual, text that has abso-fluck-ingly zilch to do with the non-problem the TS has.
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Difference space showed for TS and it... autobox DB2 1 Thu Apr 14, 2016 1:07 pm
No new posts Difference Between CICS WebSupport an... sachinji84 CICS 1 Mon Mar 07, 2016 7:25 pm


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