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

figurative constant in if condition


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

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Wed Jan 11, 2006 11:26 am
Reply with quote

01 empcode value x(8)
****************************
move zeros to empcode Or move '00000000' to empcode

If empcode = zero/zeros

Will this work, can the fiurative constant be used for checking the Conditons of an alphanumeric operation ,

in the IBm maunal it is given as when we move zeros to an alphanemeric item then alphanumeric zero will be moved, what is alphanumeric zero
************************************************************
2nd Question

01 empno value x(8)

How to check the if condition for both spaces OR zeros
Some times from the screen the the data comes as 00000000

Can i use the below if condition
if empno = Spaces or Zeros


Cheers
Chaitanya
Back to top
View user's profile Send private message
gowtham_1982
Warnings : 1

Active User


Joined: 02 Dec 2005
Posts: 109

PostPosted: Wed Jan 11, 2006 11:35 am
Reply with quote

EnjoyMF wrote:
01 empcode value x(8)
****************************
move zeros to empcode Or move '00000000' to empcode

If empcode = zero/zeros

Will this work, can the fiurative constant be used for checking the Conditons of an alphanumeric operation ,

in the IBm maunal it is given as when we move zeros to an alphanemeric item then alphanumeric zero will be moved, what is alphanumeric zero
************************************************************
2nd Question

01 empno value x(8)

How to check the if condition for both spaces OR zeros
Some times from the screen the the data comes as 00000000

Can i use the below if condition
if empno = Spaces or Zeros


Cheers
Chaitanya



hai Chaitanya,

for your first question,

i don't think we can enable this feature as i think we can use logical operators only with respect to conditional statements.

for your second question,

yeah we can use this check and this code will be fine.


corrections welcomed...

gowtham
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Wed Jan 11, 2006 11:48 am
Reply with quote

HI,

Quote:
01 empcode value x(8)
****************************
move zeros to empcode Or move '00000000' to empcode

If empcode = zero/zeros

Will this work, can the fiurative constant be used for checking the Conditons of an alphanumeric operation ,


Yes it will work Fine.

Regards
Rupesh
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Jan 12, 2006 5:56 am
Reply with quote

Hello EnjoyMF,

To answer the second part of your first question:

Quote:

01 empcode value x(8)
****************************
move zeros to empcode Or move '00000000' to empcode

If empcode = zero/zeros

Will this work, can the fiurative constant be used for checking the Conditons of an alphanumeric operation ,

in the IBm maunal it is given as when we move zeros to an alphanemeric item then alphanumeric zero will be moved, what is alphanumeric zero


In a PIC X defined field, the characters are stored as USAGE DISPLAY where 'A' = hex x'C1', 'B' = x'C2' etc. Numerics are stored the same way. '0' = x'F0', '1' = x'F1' etc. So, if you move zeros to emplcode, you store an alphanumeric zero, or x'F0F0F0F0F0F0F0F0' NOT x'0000000000000000'. For this you would have to move LOW-VALUES to empcode.

Let me know if this is not clear.
Back to top
View user's profile Send private message
nikyojin

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Thu Jan 12, 2006 9:30 am
Reply with quote

Hi DavidatK,
Quote:
In a PIC X defined field, the characters are stored as USAGE DISPLAY where 'A' = hex x'C1', 'B' = x'C2' etc. Numerics are stored the same way. '0' = x'F0', '1' = x'F1' etc. So, if you move zeros to emplcode, you store an alphanumeric zero, or x'F0F0F0F0F0F0F0F0' NOT x'0000000000000000'

I am somewhat confused. Does this explanation indicate in a field declared as PIC 9 moving zeros will display the hex value o/p as x'0000000000000000'.Pls inform me regarding this.

Regards,
Nikhil .S.
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Jan 12, 2006 9:53 pm
Reply with quote

Hi nikyojin

Quote:
I am somewhat confused. Does this explanation indicate in a field declared as PIC 9 moving zeros will display the hex value o/p as x'0000000000000000'.Pls inform me regarding this.


My apologies, I didn?t mean to confuse. A move of ?zero? to PIC 9 will also result in x?F0F0F0F0F0F0F0F0?.

The previous question answered was addressing what was meant by ?alphanumeric zero?. I wanted to clarify that a move of ?zero? to PIC X resulted in x?F0F0F0F0F0F0F0F0?, and not x?0000000000000000? (binary zero).

Sorry for the confusion,

Dave
Back to top
View user's profile Send private message
nikyojin

New User


Joined: 05 Oct 2005
Posts: 94

PostPosted: Fri Jan 13, 2006 8:52 am
Reply with quote

Hi Dave,

Thanks for the clarification.

Regards,
Nikhil .S.
Back to top
View user's profile Send private message
EnjoyMF

New User


Joined: 27 May 2005
Posts: 88

PostPosted: Tue Jan 17, 2006 5:47 pm
Reply with quote

Hi DavidatK/nikyojin

Thanks for the reply but i have a doubt
in case of move zeros to alphanumeric item
will this work
If empcode = zero/zeros

or
should we give as
if empcode = low-values


if possible can u plz give some examples in ur explanation

thanks
Chaitanya
Back to top
View user's profile Send private message
sbalajibe

New User


Joined: 15 Aug 2005
Posts: 62

PostPosted: Wed Jan 18, 2006 11:01 am
Reply with quote

Hi EnjoyMF,


eg :

01 a pic x(2) .
01 b pic 9(2).

if u move zeros to both a will contain alphanumeric 0 ie'00'
and b will contain 00

and u can use the same for checking in condition also


thanks
balaji
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 How to give complex condition in JCL . CLIST & REXX 30
No new posts selectively copy based on condition DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Control-m JOB executing even when the... Compuware & Other Tools 6
No new posts Dynamic condition checks COBOL Programming 5
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top