IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What is PSEUDOCODE in this program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 1:16 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 1:24 pm
Reply with quote

Quote:
PLZ LET ME KNOW ABOUT THE PSEUDOCODE
What is the question?
Yes, it looks like psuedocode?
Back to top
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 1:37 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 1:43 pm
Reply with quote

The location of the GO TO is where it looks like it should be.....
Back to top
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 2:22 pm
Reply with quote

hi william kindly let me know
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 2:26 pm
Reply with quote

nayaksidd wrote:
kindly let me know
Let you know what?
Back to top
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 2:43 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 2:55 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 5:00 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:19 pm
Reply with quote

nayaksidd wrote:
I am giving u the code plz let me know.
Know what?
Back to top
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 5:41 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:46 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 5:57 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 6:02 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 6:06 pm
Reply with quote

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
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 6:13 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 6:16 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 6:22 pm
Reply with quote

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
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 6:29 pm
Reply with quote

Kindly let me know
Back to top
View user's profile Send private message
nayaksidd

New User


Joined: 22 May 2007
Posts: 16
Location: bangalore

PostPosted: Mon Jul 23, 2007 6:41 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top