How to check for Spaces in Easytrieve



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Re: How to check for Spaces in Easytrieve

Postby dick scherrer » Fri Oct 12, 2012 8:14 pm

Hello,

The question was about using SPACES instead of
IF  some-field  = ‘     ‘


I do not believe there is an issue when placing spaces between quotes. The question was about using (what in COBOL are known as Figurative Constants) SPACES.

I see nothing wrong with your code, it just does not address the question the TS posted.

And, according to the documentation, SPACES can be used to MOVE or compare (IF).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: How to check for Spaces in Easytrieve

Postby BillyBoyo » Fri Oct 12, 2012 8:30 pm

IF fieldname EQ ' '
IF fieldname SPACES


can be coded.

IF fieldname EQ SPACES


cannot.

We would've expected the TS to have some variant of the last, but we'll probably never know for sure. I don't have access at the moment. Perhaps you can "toss it in" and see if you get the error message reported?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: How to check for Spaces in Easytrieve

Postby c62ap90 » Fri Oct 12, 2012 9:41 pm

BillyBoyo wrote:
IF fieldname EQ ' '
IF fieldname SPACES


can be coded.

IF fieldname EQ SPACES


cannot.

We would've expected the TS to have some variant of the last, but we'll probably never know for sure. I don't have access at the moment. Perhaps you can "toss it in" and see if you get the error message reported?


As we suspected...
*--- INPUT ---                                       
I-REC          1     80  A                           
FIELDNAME      1      1  A                           
*                                                     
*                                                     
JOB INPUT FILEA    NAME OUTPUT                       
*                                                     
*IF FIELDNAME EQ ' '        * SYNTAX OK               
*IF FIELDNAME SPACES        * SYNTAX OK               
 IF FIELDNAME EQ SPACES     * B082 NAME IS UNDEFINED 
     DISPLAY 'GOT A HIT'                             
     GOTO JOB                                         
 END-IF                                               

These users thanked the author c62ap90 for the post:
BillyBoyo (Sat Oct 13, 2012 5:49 am)
c62ap90
 
Posts: 125
Joined: Thu Oct 11, 2012 10:24 pm
Has thanked: 1 time
Been thanked: 7 times

Previous

Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post