Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What is PSEUDOCODE in this program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: What is PSEUDOCODE in this program
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 1:24 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 1:43 pm    Post subject:
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    Post subject: hi
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 2:26 pm    Post subject: Re: hi
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 2:55 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:19 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 5:46 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 6:02 pm    Post subject:
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    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Mon Jul 23, 2007 6:13 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm
No new posts Need points to tune IMS Checkpoint Pr... satish.ms10 IMS DB/DC 2 Fri Sep 30, 2016 4:12 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us