Pl/1 Output ISSUE



IBM's cross-platform compiler PL/I for MVS, VM & VSE, OS/390 and Enterprise PL/I for z/OS

Re: Pl/1 Output ISSUE

Postby petercoloney » Tue Dec 20, 2011 1:30 pm

i'm beginner... and the code compiled and executed... with max = 0 but im not sure the output which i see is correct or not. guidance is needed.
petercoloney
 
Posts: 7
Joined: Mon Dec 19, 2011 11:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: Pl/1 Output ISSUE

Postby BillyBoyo » Tue Dec 20, 2011 1:35 pm

petercoloney wrote:[...]
1.100000E+01            2.200000E+01            3.300000E+01   

[...]


The above are

11                   22                       33


Just in "scientific notation" 1.1 times ten to the power of one, 2.2 times ten to the power of one, 3.3 times ten to the power of one. Ten to the power of one is ten.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Pl/1 Output ISSUE

Postby NicC » Tue Dec 20, 2011 1:55 pm

Why do you think that the output could be wrong? Do you think that the computer could have made a mistake?

If you were expecting 11,22 and 33 in plain 'English' then you need to convert your data from FLOAT BIN to PIC'9999' (however many 9s you need/want). You also, probably, had DATA CONVERSION WILL BE DONE BY SUBROUTINE CALL messages. Although this is OK, for performance you should read the data into PIC variables, move to FIXED (or FLOAT) DEC fields and then to FLOAT BIN. Reverse the process after your calculation to get displayable values. You did not need to go to FLOAT BIN - FIXED DEC would have been fine.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Pl/1 Output ISSUE

Postby petercoloney » Tue Dec 20, 2011 2:04 pm

thanks BillyBoyo for helping in understanding the output: "Just in "scientific notation" 1.1 times ten to the power of one, 2.2 times ten to the power of one, 3.3 times ten to the power of one. Ten to the power of one is ten."

NicC: i didn't say the output was wrong.. i didn't understand the output and was not sure whether it was correct or not.
petercoloney
 
Posts: 7
Joined: Mon Dec 19, 2011 11:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: Pl/1 Output ISSUE

Postby petercoloney » Tue Dec 20, 2011 2:06 pm

How i use get integer values displayed in output like 11,22,33. Also how can i accept character values from jcl and display it output.

Any help will be appreciated.
petercoloney
 
Posts: 7
Joined: Mon Dec 19, 2011 11:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: Pl/1 Output ISSUE

Postby NicC » Tue Dec 20, 2011 2:16 pm

1) You inferred that that the output COULD be wrong and that is how I replied. Id id not say that said the output WAS wrong.
2) I have already explained how to get you numbers displayed - you may need to use picture edit characters if you want commas and decimal points etc. For character data simple GET to a CHAR variable and PUT from same. All this is in the manuals. We do not teach here - just try and help when things go wrong (hence my generalised comments).
3) Note that you do not 'accept character values from jcl' - you accept them from a dataset which the OS has generated from the JCL instructions that the OS received.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Pl/1 Output ISSUE

Postby Akatsukami » Tue Dec 20, 2011 9:24 pm

petercoloney wrote:How i use get integer values displayed in output like 11,22,33. Also how can i accept character values from jcl and display it output.

Any help will be appreciated.

To expand on NicC's answer, read the fine manual on picture specification characters and on edit-directed format items.
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1058
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Previous

Return to PL/I

 


  • Related topics
    Replies
    Views
    Last post