|
|
| Author |
Message |
iknow
Senior Member
Joined: 22 Aug 2005 Posts: 582 Location: Colarado, US
|
|
|
|
Hi All
I want the program to follow a certain path if the value of a
variable is spaces. How do I code this logic. |
|
| Back to top |
|
 |
References
|
|
 |
Sridevi_C
Active User
Joined: 22 Sep 2005 Posts: 107 Location: Concord, New Hampshire, USA.
|
|
|
|
Hi,
Try this...
Code:
WORKING STORAGE SECTION.
77 A PIC X(5).
77 B PIC X(5) VALUE SPACES.
PROCEDURE DIVISION.
IF A = B THEN DISPLAY "A IS NOT POPULATED" ELSE DISPLAY "A IS POPULATED".
There might be a more efficient way.
Regards,
Sridevi. |
|
| Back to top |
|
 |
umeshkmrsh
Active User
Joined: 21 Sep 2005 Posts: 81 Location: India
|
|
|
|
Yes there is a better way too.
Code:
WORKING STORAGE SECTION.
77 A PIC X(5).
PROCEDURE DIVISION.
IF A = SPACES THEN
DISPLAY "A IS NOT POPULATED"
ELSE
DISPLAY "A IS POPULATED"
END-IF. |
|
| Back to top |
|
 |
mathiprakash
New User
Joined: 29 Apr 2005 Posts: 15 Location: Pune, India.
|
|
|
|
Hi Iknow,
You are going to check whether the variable is having spaces or not, right?
Then why cann't you use this,
IF <variable> IS SPACES
This is a better option to check.
Regards,
Matty |
|
| Back to top |
|
 |
|
|