View previous topic :: View next topic
|
Author |
Message |
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Hi,
I have come across the following issue with the EPLI compiler:
Existing code:
Code: |
****
DCL 1 Q_VALS BASED (Q_VALS_PTR),
3 ROW (0:119),
5 Q1 Float Bin(53),
5 Q2 Float Bin(53),
5 Q3 Float Bin(53) ;
CALL CALC_JL2D ( Q_VALS1.Q1,
Q_VALS2.Q1,
Q_VALS.Q1 );
CALC_JL2D: PROC (QA,QB,PROB);
DCL QA(*) FLOAT BIN(53);
DCL QB(*) FLOAT BIN(53);
DCL PROB(*) FLOAT BIN(53);
DO I....To ...;
PROB(I)= ...;
END;
END;
**** |
Code'd
With MVSPLI the value of Q_VALS changes after the Call to the proc but with EPLI the value of Q_VALS doesn't change .
The EPLI compile listing has the following OPTIONS:BYADDR RETURNS(BYADDR).
Can some one please explain why EPLI functions differently here and whether changing the compile options would make it behave like MVSPLI ?
Thanks.
Arnab |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Well, the first 2 variables you are passing aren't referenced in the code snippet shown. Q_VALS1 and Q_VALS2 are not shown - ?? and you don't show what the calculation is in the called procedure.
Garry. |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Hi,
In the main procedure:
Code: |
DCL 1 Q_VALS1 LIKE Q_VALS;
DCL 1 Q_VALS2 LIKE Q_VALS;
|
In the called procedure:
Code: |
DCL PROB_STILL_ALIVE(2) FLOAT BIN(53);
DCL PROB_CLAIM_THIS_YR FLOAT BIN(53);
DCL PROB_NO_CLAIM_BEFORE FLOAT BIN(53);
DCL PROB_GIVEN_NO_CLAIM_BEFORE FLOAT BIN(53);
DCL PROB_BOTH_DIE_THIS_YR FLOAT BIN(53);
DCL PROB_ONE_DIES_THIS_YR FLOAT BIN(53);
DO I = LBOUND(QA,1) TO HBOUND(QA,1);
PROB_BOTH_DIE_THIS_YR = QA(I) * QB(I) *
PROB_STILL_ALIVE(1) *
PROB_STILL_ALIVE(2);
PROB_ONE_DIES_THIS_YR = QA(I) * PROB_STILL_ALIVE(1) *
( 1 - PROB_STILL_ALIVE(2) ) +
QB(I) * PROB_STILL_ALIVE(2) *
( 1 - PROB_STILL_ALIVE(1) );
PROB_CLAIM_THIS_YR = PROB_BOTH_DIE_THIS_YR +
PROB_ONE_DIES_THIS_YR;
PROB_NO_CLAIM_BEFORE = PROB_STILL_ALIVE(1) +
PROB_STILL_ALIVE(2) -
( PROB_STILL_ALIVE(1) * PROB_STILL_ALIVE(2) );
PROB_GIVEN_NO_CLAIM_BEFORE = PROB_CLAIM_THIS_YR /
PROB_NO_CLAIM_BEFORE;
PROB(I) = ( PROB_GIVEN_NO_CLAIM_BEFORE *
(PERCENTAGE_ADJ/100) ) +
FLAT_ADDITION;
PROB(I) = MAX ( PROB(I),
MIN_Q_VAL );
PROB_STILL_ALIVE(1) = PROB_STILL_ALIVE(1) * (1-QA(I));
PROB_STILL_ALIVE(2) = PROB_STILL_ALIVE(2) * (1-QB(I));
END; |
Hope this helps. |
|
Back to top |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
Declaring a structure LIKE another structure only gives the names and attributes of the structure's variables. It does not assign values to those variables, so it's not possible to tell what values are being passed into the called procedure.
Since the Q_VALS1 and Q_VALS2 are uninitialised, it's not possible to tell what values are at those storage locations - particularly in the non-EPLI version.
Your variables in the called procedure don't seem to have initial values e.g.
Quote: |
PROB_BOTH_DIE_THIS_YR = QA(I) * QB(I) *
PROB_STILL_ALIVE(1) *
PROB_STILL_ALIVE(2); |
where the value of neither PROB_STILL_ALIVE element can be determined.
Garry. |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Thanks Gary for your reply.
Q_VALS1 and Q_VALS2 does get populated in the main para. I have not provided that bit of code as its a big program. Before the call to CALC_JL2D both Q_VALS1 and Q_VALS2 are getting populated and hold valid values.
And sorry I missed the initialization code of PROB_STILL_ALIVE .
It gets initialized to 1.0 as shown below before the DO loop:
PROB_STILL_ALIVE(*) = 1.0;
Thanks. |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Any updates on this please ?
I've tried playing around the code, but still cannot understand how MVS and EPLI is differentiating this.
Has this something to do with the array definition and its interpretation in both the compilers ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
Any updates on this please ? |
general consideration on forums...
usually when asking on a forum You get replies based on experience
( more or less close in time - both practical and/or theoretical )
quick and dirty one liner tests, samples availability
and You would get them in a very short time span,
... maybe for samples the time to find them in "SYS1.BASKETLIB"
chances to find somebody doing some long term research or experiments
are pretty thin!
anyway for an issue like Yours the best road would be to contact Your support and open an issue with IBM |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
I have found something different in both the compilers.
In EPLI compiler listing default is connected while in MVSPLI, default is nonconnected.
This may be causing an issue, will test and let you know if it works. |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
It works fine with EPLI if I declare tha PROB(*) array as NONCONNECTED. |
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Though it words fine with EPLI now when I declare the variable as NONCONNECTED, it throws a compilation error for the same code with MVSPLI.
DCL PROB(*) FLOAT BIN(53) NONCONNECTED;
IEL0317I S 65 INVALID ATTRIBUTE SPECIFICATION AFTER 'OB(*) FLOAT BIN(53)' 'NONCONNECTED' IGNORED.
Does anyone has idea about this ? I have raised it with IBM but if anyone is already aware of this issue could you please let me know how to resolve it. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
Back to top |
|
|
arnab
New User
Joined: 13 Mar 2006 Posts: 59 Location: UK
|
|
|
|
Thanks Enrico. |
|
Back to top |
|
|
|