View previous topic :: View next topic
|
Author |
Message |
sajjan jindal Warnings : 1 New User
Joined: 09 Sep 2007 Posts: 60 Location: india
|
|
|
|
Hi,
What will happen if we perform the following Para:
Perform 1000-Initialize thru 1000-Initialize.
Regards,
Sajjan. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
why don' t You try and let us know ?? |
|
Back to top |
|
|
vinilan
New User
Joined: 24 Jul 2008 Posts: 1 Location: chennai
|
|
|
|
I think it is syntatically incorrect as both the initiation para and end para are same in this case for PERFORM statement
vinilan vetha |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Actually, COBOL 3.4 accepts it without error:
Code: |
000013 PROCEDURE DIVISION.
000014 MOVE LV-BYTE TO WS-VALUE-BYTE.
000015 DISPLAY WS-COMP-FIELD.
000016 PERFORM 1000-INITIALIZE THROUGH 1000-INITIALIZE.
000017 STOP RUN.
000018
000019 1000-INITIALIZE.
000020 MOVE X'05' TO LV-BYTE.
1PP 5655-G53 IBM Enterprise COBOL for z/OS 3.4.1 MF0087 Date 0 |
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hello ,
I believe it will execute move x'05' to LV-BYTE. |
|
Back to top |
|
|
Debabrata Pruseth
New User
Joined: 11 Dec 2008 Posts: 59 Location: Pune , India
|
|
|
|
It will PERFORM the 1000-INITIALIZE paragraph once . It is a good interview question that i had once come across. |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
It indeed performed 1000-para only once.
Code: |
0000-PARA.
PERFORM 1000-PARA THRU 1000-PARA.
STOP RUN.
1000-PARA.
DISPLAY '1000-'.
|
result
Code: |
********************************* TOP OF DATA **********************************
1000-
******************************** BOTTOM OF DATA ******************************** |
|
|
Back to top |
|
|
sajjan jindal Warnings : 1 New User
Joined: 09 Sep 2007 Posts: 60 Location: india
|
|
|
|
Thank You friends, even i tried and found the same results. |
|
Back to top |
|
|
|