View previous topic :: :: View next topic

Author 
Message 
EnjoyMF
New User
Joined: 27 May 2005 Posts: 88




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 




gowtham_1982 Warnings : 1 Active User
Joined: 02 Dec 2005 Posts: 109




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 


Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 464




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 


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




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 LOWVALUES to empcode.
Let me know if this is not clear. 

Back to top 


nikyojin
New User
Joined: 05 Oct 2005 Posts: 94




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 


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




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 


nikyojin
New User
Joined: 05 Oct 2005 Posts: 94




Hi Dave,
Thanks for the clarification.
Regards,
Nikhil .S. 

Back to top 


EnjoyMF
New User
Joined: 27 May 2005 Posts: 88




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 = lowvalues
if possible can u plz give some examples in ur explanation
thanks
Chaitanya 

Back to top 


sbalajibe
New User
Joined: 15 Aug 2005 Posts: 62




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 


