View previous topic :: View next topic
|
Author |
Message |
Liang Gao
New User
Joined: 22 Mar 2012 Posts: 6 Location: china
|
|
|
|
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
JOBLOG1:
Code: |
*******************
IN_DUABD9 = 12
OT_QTFAZ = 12.00
******************* |
RUN2: CHANGE the PIC'99' TO PIC'-9'.LIKE BELOW
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
senthilnathanj
New User
Joined: 31 Jul 2007 Posts: 47 Location: chennai
|
|
|
|
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 |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1306 Location: Vilnius, Lithuania
|
|
|
|
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 |
|
|
|