Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

figurative constant in if condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: figurative constant in if condition
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    Post subject: Re: figurative constant in if condition
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: 464

PostPosted: Wed Jan 11, 2006 11:48 am    Post subject: Re: figurative constant in if condition
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    Post subject: Re: figurative constant in if condition
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    Post subject: Re: figurative constant in if condition
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    Post subject: Re: figurative constant in if condition
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    Post subject: Re: figurative constant in if condition
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    Post subject:
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    Post subject:
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    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
No new posts INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts INCLUDE condition questions van bui DFSORT/ICETOOL 1 Thu Jun 30, 2016 9:52 am
No new posts 2 vsam file compare and update a fiel... ABINAYATHULASI DFSORT/ICETOOL 6 Sun May 29, 2016 11:15 am
No new posts File matching using specific condition mf_karthik DFSORT/ICETOOL 3 Fri Nov 20, 2015 11:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us