View previous topic :: View next topic
|
Author |
Message |
nileshp
New User
Joined: 25 Feb 2006 Posts: 31
|
|
|
|
Can anyone tell me if CUA-LABEL-FMT-TYPO is true ,
Where control will go?
PERFORM 1002-GU-CUSADR
000446 IF WS-CUSADR-NORESP
000447 IF CUA-LABEL-FMT-TYPEO
000448 CONTINUE
000449 ELSE
000450 MOVE 'Y' TO WS-ERROR-SW
000451 MOVE -1 TO ORMNORDL
000452 MOVE '8' TO ORFNORDA
000453 MOVE 'CUSTOMER NOT SET UP FOR LABELS'
000454 TO ORMMSGO
455 GO TO 150-EXIT.
PERFORM 160-EDIT-SCREEN THRU 160-EXIT. |
|
Back to top |
|
|
ramfrom84
New User
Joined: 23 Aug 2006 Posts: 93 Location: chennai
|
|
|
|
IF A=1
PERFORM PARA-A
CONTINUE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.
Example 1
If A=1
control goes to para-a and then goest to move statement.
IF A=1
PERFORM PARA-A
NEXT SENTENCE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.
Example 2
If A=1
control goes to para-a and then COME OUT. Move stament will not perform
for ur code both contiue and next sentence ll same.. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
|
|
Hi nileshp,
Control goes to the Perform statement if the condition is true. |
|
Back to top |
|
|
mkk157
Active User
Joined: 17 May 2006 Posts: 310
|
|
Back to top |
|
|
nileshp
New User
Joined: 25 Feb 2006 Posts: 31
|
|
|
|
Thanks for you help
ramfrom84 wrote: |
IF A=1
PERFORM PARA-A
CONTINUE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.
Example 1
If A=1
control goes to para-a and then goest to move statement.
IF A=1
PERFORM PARA-A
NEXT SENTENCE
ELSE
IF A=2
PERFORM PARA-B
ELSE
PERFORM PARA-C
END-IF
MOVE 100 TO FIELD-A
END-IF.
Example 2
If A=1
control goes to para-a and then COME OUT. Move stament will not perform
for ur code both contiue and next sentence ll same.. |
|
|
Back to top |
|
|
nileshp
New User
Joined: 25 Feb 2006 Posts: 31
|
|
|
|
Thanks for you help
mkk157 wrote: |
Hi nileshp,
Control goes to the Perform statement if the condition is true. |
|
|
Back to top |
|
|
socker_dad
Active User
Joined: 05 Dec 2006 Posts: 177 Location: Seattle, WA
|
|
|
|
Oh, and Nilesh? Please code without those awful GO TO statements, k?
|
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
The CONTINUE goes to statement next after the Explicit scope terminator such as (END-IF, END-PERFORM etc...) but the NEXT Statement goes after the Implicit scope terminator (period .). |
|
Back to top |
|
|
rameshfoa
New User
Joined: 05 Apr 2007 Posts: 27 Location: chennai
|
|
|
|
priyamnavada wrote:
Quote: |
The CONTINUE goes to statement next after the Explicit scope terminator such as (END-IF, END-PERFORM etc...) but the NEXT Statement goes after the Implicit scope terminator (period .). |
I think it is vice versa. ..Next sentence goes to stmt after explicit treminators(END-IF, END-PERF)....and CONTINUE goes just to next sentence(does nothing, it will behave as if not coded)... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Hi,
A small background:
CONTINUE statement is functionally similar to the EXIT statement but their objectives are different. While EXIT should be used to have a common end point for a sequence of paragraphs, CONTINUE can be used anywhere when a null path is required. It can also be used in IF statements in place of NEXT SENTENCE phrase.
Sometimes, we encounter situations where no action needs to be specified if the situation is true, but some actions are necessary if the condition is false. In that case, the NEXT SENTENCE pharse can be used for the then part & the else part can be written to indicate the action required.
Consider the following IF statement:
IF OK-BALANCE NEXT SENTENCE ELSE MOVE 2 TO BALANCE-CODE
I hope, flow chart will make understanding better, so I draw that for the above If statement, PFA.
For your post, CONTINUE & NEXT SENTENCE will serve the same purpose. |
|
Back to top |
|
|
priyamnavada
New User
Joined: 24 Dec 2005 Posts: 52 Location: hyderabad
|
|
|
|
Hi rameshfoa,
what i wrote is correct man. After assuring it only, i answered it. |
|
Back to top |
|
|
|