View previous topic :: View next topic
|
Author |
Message |
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
hi
The following details I am mentioning for geting the price in my pgm.
1. Price is not found, i.e. FN-UNIT-NOTFND case true.
2. Displays written to SYSOUT
3. Zeroes moved to some fields
4. GO TO 3000-EXIT, causing thE FOLLOWING code to be skipped:>>
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED
following is the code:>>>>>>>>>>>>>>>
3000-PRICES SECTION.
IF FN-CRITICAL-ERROR
DISPLAY '*** '
DISPLAY '*** ***'
DISPLAY ' !!! ABENDING !!!'
MOVE ZEROES TO WS-ASOF-CASH
PERFORM 9000-ABEND-ROUTINE.
IF FN-UNIT-NOTFND
DISPLAY '*** '
DISPLAY '**********'
DISPLAY '*********"
DISPLAY '!!! WARNING !!!'
MOVE ZEROES TO WS-ASOF-CASH
WS-TRADE-NAV
WS-PROCESS-NAV
GO TO 3000-EXIT.
MOVE UV-PRICE TO WS-TRADE-NAV.
MOVE WS-ASOF-FUND TO UV-FUND.
MOVE FN-LATEST-DATE TO UV-DATE.
MOVE 'FUND' TO FN-UNIT-ACCESS.
MOVE 'READUNIT' TO FN-OPTION.
CALL 'XXXXX' USING FUND-IO-PARAMETERS
FUND-INFO
UNIT-VALUE-WORK.
IF FN-CRITICAL-ERROR
DISPLAY '*** '
DISPLAY '*** ***'
DISPLAY ' !!! ABENDING !!!'
MOVE ZEROES TO WS-ASOF-CASH
PERFORM 9900-ABEND-ROUTINE.
IF FN-UNIT-NOTFND
DISPLAY '*** '
DISPLAY '********'
DISPLAY '**********'
DISPLAY '!!! WARNING !!!'
MOVE ZEROES TO WS-ASOF-CASH
WS-PROCESS-NAV
GO TO 3000-EXIT.
MOVE UV-PRICE TO WS-PROCESS-NAV.
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED.
3000-EXIT.
EXIT. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Quote: |
PLZ LET ME KNOW ABOUT THE PSEUDOCODE |
What is the question?
Yes, it looks like psuedocode? |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
Hi the following is the condition which i got for which I am getting the error .plz let me know where we have to gv the GOTO statment.
1. Price is not found, i.e. FN-UNIT-NOTFND case true.
2. Displays written to SYSOUT
3. Zeroes moved to some fields
4. GO TO 3000-EXIT, causing thE FOLLOWING code to be skipped:>>
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED
following is the code:>>>>>>>>>>>>>>> |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
The location of the GO TO is where it looks like it should be..... |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
hi william kindly let me know |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
nayaksidd wrote: |
kindly let me know |
Let you know what? |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
Hi if u see the code there is a stmt:
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED
which is getting bypassed becoz of GOTO,so hhow to put the above stmt,so WONT BE BYPASSED IF THE CONDITION IS TRUE |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
If the price is not found, what are you going to multiply the shares by?
If you want to do the multiply:
Do it before the price-not-found test;
Do it in the price-not-found test;
Remove the GO TO from the price-not-found test. |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
Hi thnx for the help,well as u have mentioned for muktiplication logic We have to do before price-nt-fnd test and inside price not fnd test.As in the code there are 2 price nt found test,so in which one I have to apply this.I am giving u the code plz let me know..follwing the code:=====>>
7000-GET-PRICES SECTION.
MOVE WS-ASOF-FUND TO UV-FUND.
MOVE WS-ASOF-DATE TO UV-DATE.
MOVE 'FUND' TO FU-UNIT-ACCESS.
MOVE 'READUNIT' TO FU-OPTION.
CALL 'PSPL024' USING FUND-UNIT-IO-PARAMETERS
FUND-INFO
UNIT-VALUE-WORK.
IF FU-CRITICAL-ERROR
DISPLAY '*** 7000-GAIN-LOSS :KEY = ' UV-KEY
DISPLAY '*** CRITICAL ERROR IN PSPL024 ***'
DISPLAY ' !!! ABENDING !!!'
MOVE ZEROES TO WS-ASOF-CASH
PERFORM 9900-ABEND-ROUTINE.
IF FU-UNIT-NOTFND
DISPLAY '*** 7000-GAIN-LOSS :KEY = ' UV-KEY
DISPLAY 'UV PRICE NOT FOUND FOR ' WS-ASOF-FUND
DISPLAY 'ON ' WS-ASOF-DATE
DISPLAY '!!! WARNING !!!'
MOVE ZEROES TO WS-ASOF-CASH
WS-TRADE-NAV
WS-PROCESS-NAV
GO TO 7000-EXIT.
MOVE UV-PRICE TO WS-TRADE-NAV.
MOVE WS-ASOF-FUND TO UV-FUND.
MOVE FU-LATEST-DATE TO UV-DATE.
MOVE 'FUND' TO FU-UNIT-ACCESS.
MOVE 'READUNIT' TO FU-OPTION.
CALL 'PSPL024' USING FUND-UNIT-IO-PARAMETERS
FUND-INFO
UNIT-VALUE-WORK.
IF FU-CRITICAL-ERROR
DISPLAY '*** 7000-GAIN-LOSS :KEY = ' UV-KEY
DISPLAY '*** CRITICAL ERROR IN PSPL024 ***'
DISPLAY ' !!! ABENDING !!!'
MOVE ZEROES TO WS-ASOF-CASH
PERFORM 9900-ABEND-ROUTINE.
IF FU-UNIT-NOTFND
DISPLAY '*** 7000-GAIN-LOSS :KEY = ' UV-KEY
DISPLAY 'UV PRICE NOT FOUND FOR ' WS-ASOF-FUND
DISPLAY 'ON ' WS-ASOF-DATE
DISPLAY '!!! WARNING !!!'
MOVE ZEROES TO WS-ASOF-CASH
WS-PROCESS-NAV
GO TO 7000-EXIT.
MOVE UV-PRICE TO WS-PROCESS-NAV.
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED.
7000-EXIT.
EXIT. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
nayaksidd wrote: |
I am giving u the code plz let me know. |
Know what? |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
Hi thnx for the help,well as u have mentioned for muktiplication logic We have to do before price-nt-fnd test and inside price not fnd test.As in the code there are 2 price nt found test,so in which one I have to apply this |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
nayaksidd wrote: |
As in the code there are 2 price nt found test,so in which one I have to apply this |
Apply what?
Two "price nt found test"s? I only see one......
Are you familiar with COBOL? What language do you normally program in? |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
hi following is error,which is coming in 2nd record read sir,fowwoling are steps =====>
1 The 7000-GET-PRICES Section is performed to obtain the fund price.
2. Price is found, i.e. neither FU-CRITICAL-ERROR nor FU-UNIT-NOTFND is true.
3. MOVE UV-PRICE TO WS-TRADE-NAV
4. Do the following computation:
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED.
5. Complete processing of first read input record.
6. Second input transaction read in and processed.
7. The 7000-GET-PRICES Section is performed to obtain the fund price.
8. Price is not found, i.e. FU-UNIT-NOTFND case true.Then
a. Displays written to SYSOUT
b. GO TO 7000-EXIT, causing this code to be skipped:
MULTIPLY BT-SHARES BY UV-PRICE
GIVING WS-CTT-NET-ADJ-RED ROUNDED.
the above is getting shipped in 2nd read of recoed. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
I give up......
Again, If the price is not found, why would you not want to skip the multply? With no valid data, why do the multiply? |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
No sir i thought it shd be required any way i got my answer,many many many thnx for ur help williams..once again thanx..but one thing if there is no valid data means it will skip the multiplication and come out of loop. WS-CTT-NET-ADJ-RED valuse will ve zero ...rite sir |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
nayaksidd wrote: |
but one thing if there is no valid data means it will skip the multiplication and come out of loop. WS-CTT-NET-ADJ-RED valuse will ve zero ...rite sir |
I'd guess that the "loop" is governed by a perform 7000-GET-PRICES so branching to the exit will probably allow the loop to continue with the next record (unless the perform checks the error too).
It looks to me like WS-CTT-NET-ADJ-RED will have the value of the last multiply, I don't see where it is getting reset to zero. |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
why i am asking about WS-CTT-NET-ADJ-RED valuse becoz its been used in other paras ,so its giving s0c7,well i think to over come we need to initialise it ,as its a comp-3 vatiable. |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
u are correct its taking last multiply value ,which is not required ,so if we initialise it I think this will be overcomed rite |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
Kindly let me know |
|
Back to top |
|
|
nayaksidd
New User
Joined: 22 May 2007 Posts: 16 Location: bangalore
|
|
|
|
hi williams thnx for ur help well kindly let me know if i am initializing i think the problem will be solved rite.thnx |
|
Back to top |
|
|
|