Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Regarding Continue verb

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
varalakshmi.G

New User


Joined: 04 Jun 2007
Posts: 55
Location: Hyderabad

PostPosted: Mon Feb 18, 2008 11:14 pm    Post subject: Regarding Continue verb
Reply with quote

Hi All,

Can any one tell me the functionality of the below two logics.

If Emp-id = '34587'
continue
else if emp-id='78657'
continue
else if emp-id='3145'
continue
else
next sentence
end-if
move emp-id emp-out
write emp-rec.

If emp-id = ''34587'
or '78657'
or '3145'
move emp-id emp-out
write emp-rec.

Thanks in Advance,
Varalakshmi.G
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Feb 19, 2008 12:04 am    Post subject:
Reply with quote

Hi,

Did You try to execute it..if yes, what was the result?
Back to top
View user's profile Send private message
kishorimf

New User


Joined: 30 Nov 2007
Posts: 1
Location: California

PostPosted: Tue Feb 19, 2008 2:51 am    Post subject: Re: Regarding Continue verb
Reply with quote

varalakshmi.G wrote:
Hi All,

Can any one tell me the functionality of the below two logics.

If Emp-id = '34587'
continue
else if emp-id='78657'
continue
else if emp-id='3145'
continue
else
next sentence
end-if
move emp-id emp-out
write emp-rec.

If emp-id = ''34587'
or '78657'
or '3145'
move emp-id emp-out
write emp-rec.

Thanks in Advance,
Varalakshmi.G





In the first logic... if EMP id is "34587" or "78657" or "3145" emprec is written,if there are records other than these empid's then it will come out of the loop.

In second logic there is no condition to check if it come across a record other than the above three empid's.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 3:18 am    Post subject: Re: Regarding Continue verb
Reply with quote

varalakshmi.G wrote:
If Emp-id = '34587'
continue
else if emp-id='78657'
continue
else if emp-id='3145'
continue
else
next sentence
end-if
move emp-id emp-out
write emp-rec.
Wouldn't that actually evaluate to:
Code:

If Emp-id = '34587'
  continue
else
  if emp-id='78657'
    continue
  else
    if emp-id='3145'
     continue
    else
     next sentence
    end-if
  move emp-id emp-out
  write emp-rec
  end-if
end-if
.
Back to top
View user's profile Send private message
shitij

New User


Joined: 09 Sep 2005
Posts: 31
Location: Delhi

PostPosted: Tue Feb 19, 2008 11:52 am    Post subject: Re: Regarding Continue verb
Reply with quote

Think its actually:

Code:

If Emp-id = ('34587' or  '78657' or '3145')
   continue
else
   next sentence
end-if

move emp-id emp-out
write emp-rec.




Regards,
Shitij
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Feb 19, 2008 6:26 pm    Post subject: Re: Regarding Continue verb
Reply with quote

shitij wrote:
Think its actually:

Code:

If Emp-id = ('34587' or  '78657' or '3145')
   continue
else
   next sentence
end-if

move emp-id emp-out
write emp-rec.
Why?
Without an explicit IF terminator, the implicit terminator is the period.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Thu Feb 21, 2008 12:08 am    Post subject:
Reply with quote

Hi Varalakshmi.G,

The 2 "logics" produce identical results. Guess which one is preferred.

PS

This is probably the most straightforward:
Code:

If emp-id = ('34587' or  '78657' or '3145')
   move emp-id to emp-out
   write emp-rec
end-if
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
This topic is locked: you cannot edit posts or make replies. Job to wait and continue based on reply yugendran COBOL Programming 5 Wed Oct 05, 2016 1:46 pm
No new posts Not enough virtual memory is availabl... Vinay Pushpala IBM Tools 16 Tue Sep 13, 2016 4:37 pm
No new posts How to continue ftp line when the fil... jasorn JCL & VSAM 1 Fri Mar 14, 2014 5:47 am
No new posts Logic of START verb with Read next sandeep kumar302 COBOL Programming 6 Tue Feb 04, 2014 12:21 pm
No new posts Continue PARM in SYSIN DD * vishalbshah DB2 9 Thu Apr 19, 2012 3:23 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us