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

Question regarding perform.


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

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Fri Nov 16, 2007 12:43 pm
Reply with quote

I have my code like this :-
Add 1
To A
Giving B

Then Perform
Varying B
By 1
Until B > 10

My question is syntax of Perform is ok??because there is no start position using From and i dont want to use From 1 as we are varying B so can i give this like :-

Perform
Varying B
From B
By 1
Until B > 10
Back to top
View user's profile Send private message
Binaya

New User


Joined: 03 Jul 2007
Posts: 77
Location: Hyderabad

PostPosted: Fri Nov 16, 2007 1:07 pm
Reply with quote

Yes we can use the above logic..
Back to top
View user's profile Send private message
shankar.v

Active User


Joined: 25 Jun 2007
Posts: 196
Location: Bangalore

PostPosted: Fri Nov 16, 2007 1:10 pm
Reply with quote

Quote:
I have my code like this :-
Add 1
To A
Giving B

Then Perform
Varying B
By 1
Until B > 10

My question is syntax of Perform is ok??because there is no start position using From and i dont want to use From 1 as we are varying B

The syntax of PERFORM statement is wrong.
Quote:
so can i give this like :-

Perform
Varying B
From B
By 1
Until B > 10

Yes, you can code like this.

You can use any one of the following PERFORM statements for your requirement.
Code:
PERFORM VARYING B FROM B BY 1 UNTIL B > 10
...
...
...
END-PERFORM

Code:
PERFORM UNTIL B > 10
COMPUTE B = B + 1                         
...
...
...
END-PERFORM
Back to top
View user's profile Send private message
jackal
Currently Banned

New User


Joined: 21 Jan 2006
Posts: 48
Location: india

PostPosted: Fri Nov 16, 2007 1:17 pm
Reply with quote

Thanks alott dudes
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
No new posts Question for file manager IBM Tools 7
No new posts question for Pedro TSO/ISPF 2
No new posts question on Outrec and sort #Digvijay DFSORT/ICETOOL 20
No new posts panel creation question TSO/ISPF 12
Search our Forums:

Back to Top