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

Perform 1000-Initialize thru 1000-Initialize


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sajjan jindal
Warnings : 1

New User


Joined: 09 Sep 2007
Posts: 60
Location: india

PostPosted: Wed Jul 15, 2009 9:05 pm
Reply with quote

Hi,

What will happen if we perform the following Para:

Perform 1000-Initialize thru 1000-Initialize.

Regards,
Sajjan.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Jul 15, 2009 9:08 pm
Reply with quote

why don' t You try and let us know ??
Back to top
View user's profile Send private message
vinilan

New User


Joined: 24 Jul 2008
Posts: 1
Location: chennai

PostPosted: Wed Jul 15, 2009 9:17 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Jul 15, 2009 10:43 pm
Reply with quote

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

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Wed Jul 15, 2009 11:10 pm
Reply with quote

Hello ,

I believe it will execute move x'05' to LV-BYTE.
Back to top
View user's profile Send private message
Debabrata Pruseth

New User


Joined: 11 Dec 2008
Posts: 59
Location: Pune , India

PostPosted: Thu Jul 16, 2009 12:06 am
Reply with quote

It will PERFORM the 1000-INITIALIZE paragraph once . It is a good interview question that i had once come across.
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Thu Jul 16, 2009 12:46 pm
Reply with quote

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
View user's profile Send private message
sajjan jindal
Warnings : 1

New User


Joined: 09 Sep 2007
Posts: 60
Location: india

PostPosted: Fri Jul 17, 2009 8:48 pm
Reply with quote

Thank You friends, even i tried and found the same results.
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 Use of Perform Thru Exit COBOL Programming 6
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... SYNCSORT 10
No new posts Covert k to 1000 / m to 1000000 using... DFSORT/ICETOOL 5
No new posts after TBSARG: Row 370 from 1000 TSO/ISPF 1
No new posts How to perform Digest Access Authenti... All Other Mainframe Topics 0
Search our Forums:

Back to Top