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

Give a practical example on condition names


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

New User


Joined: 18 Mar 2005
Posts: 48

PostPosted: Mon May 23, 2005 11:25 am
Reply with quote

hi,

can any one give a practical example on condition names.

bye,
ks reddy.
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Mon May 23, 2005 11:45 am
Reply with quote

hi,
let's take one example.Suppose on cics screen is capable of performing 4 actvities like on PF7 it will scroll backward, on PF8 it will scroll Forward, on PF10 it will scroll LEft and on PF11 it will scroll to right direction. Then u can just keep on varible as read-direction.
so you can set the value of varibale read-direction as the key pressed. Based upon that u can do certain operation.
Or like u can validate the fuction name it supports, thru condition name...
like
01 valid-function PIC x(10).
88 func1 value 'one'
88 func2 value 'two'.

like this way u can use just one varibale and get the result. Hope tis is clear to you. Let us know if u have any clarification.
Back to top
View user's profile Send private message
knd_r
Currently Banned

New User


Joined: 18 Mar 2005
Posts: 48

PostPosted: Mon May 23, 2005 8:01 pm
Reply with quote

please give me an example from your project where you used condition names?

thanks,
ks reddy.
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Mon May 23, 2005 9:40 pm
Reply with quote

Code:
01 A PIC 9.
   88 MALE VALUE 0.
   88 FEMALE VALUE 1.

ACCEPT A.

IF MALE DISPLAY "I am Male"
ELSE IF FEMALE DISPLAY "I am Female"
ELSE DISPLAY "WHO AM I".
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Tue May 24, 2005 9:34 am
Reply with quote

the example i have given is one of the real time scenario only..
Back to top
View user's profile Send private message
rameshbabu
Warnings : 1

New User


Joined: 23 May 2005
Posts: 27

PostPosted: Tue May 24, 2005 12:18 pm
Reply with quote

hi plz go thru this
Back to top
View user's profile Send private message
priya

Moderator


Joined: 24 Jul 2003
Posts: 568
Location: Bangalore

PostPosted: Tue May 24, 2005 9:20 pm
Reply with quote

Try this...


Code:
01 MARKS PIC 999.
   88 FAIL VALUE 0 THRU 50.
   88 PASS VALUE 51 THRU 100.

ACCEPT MARKS.

IF PASS DISPLAY "GO TO THRID SEM"
ELSE IF FAIL DISPLAY "WRITE ONCE AGAIN"
ELSE DISPLAY "ARE YOU FROM SRM ENGINEERING COLLEGE?".
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 Capturing COBOL job and program names... All Other Mainframe Topics 2
No new posts How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
No new posts Can you give me examples of programs ... CLIST & REXX 22
No new posts Read file names from existing file th... DFSORT/ICETOOL 6
Search our Forums:

Back to Top