MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

PLI -- BASED POINTER

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
annie
Beginner


Joined: 06 Sep 2004
Posts: 1
Topics: 1

PostPosted: Mon Sep 06, 2004 12:20 am    Post subject: PLI -- BASED POINTER Reply with quote

I have a doubt.

If anyone of you have any idea kindly share with me.

The following Program is coded and tested .



DCL FOURTH CHAR(4) INIT(' ');

DCL THIRD PIC'9999' BASED(ADDR(FOURTH));

DCL SECOND FIXED DEC(8 ) BASED(ADDR(FOURTH));



FOURTH ='AB*D';

DISPLAY('FOURTH='||FOURTH);

DISPLAY('THIRD='||THIRD);

DISPLAY('SECOND='||SECOND);





Giving following outputs :



F8 0008 FOURTH=AB*D

F8 0008 THIRD=AB*D



After that It abended. How come the variable THIRD which is of PIC '9999' type( supposed to display only numeric value) is displaying 'AB*D' whereas SECOND which is of FIXED DEC type cant ?



If THIRD is not based on ADDR( FOURTH) and assigned a value of AB*D then it will give error in compilation ( data conversion error) as '9999' specification is only for displaying numeric value.

thx
annie
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Mon Sep 06, 2004 3:24 pm    Post subject: Reply with quote

I suspect there is no conversion being done for pic'9999' because it is assumed to be a valid string which contains F0 - F9. It doesn't but since it is not a mathematical operation, no conversion is done. For SECOND, a conversion is required to turn it into a character representation and hence you get an 0C7 abend (or similar). The best way to answer this question is to use the LIST option and look at the assembler to see what it is doing. (At least it was LIST when I last used a PL/I compiler 25 years ago Smile )
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group