Problem with IF variable IS NULL

apsrbstar

Member
Hi, everyone. I am trying to find and replace blank instances of a date field with the date I want it to read. I know absolutely nothing about programming in Progress, so I'm just attempting to edit a procedure of someone elses. This is what I've ended up with:

DEF VAR a AS INT LABEL "records read" NO-UNDO.
DEF VAR b AS INT LABEL "records updated" NO-UNDO.
DEF VAR c AS INT.
MESSAGE "Processing PDSC...".
mainloop:
FOR EACH pdsc WHERE
pdsc.cono = 1 AND
pdsc.levelcd = 7.
IF NOT pdsc.refer BEGINS "Industry" THEN NEXT mainloop.
a = a + 1.
IF pdsc.startdt IS NULL THEN
ASSIGN
pdsc.startdt = "23/09/2011"
b = b + 1.
END.
DISP a b WITH FRAME aa SIDE-LABELS.


I appreciate there's some unnecessary baggage in there, but my current problem seems to be on the IF pdsc.startdt IS NULL THEN line. I get the following error message:

** Unable to understand after -- "pdsc.startdt". (247)
** Could not understand line 12. (198)

I've tried a number if variants, pdsc.startdt = "", LENGTH(pdsc.startdt) = 0 etc, but all with the same results. Can anyone please help me with the correct syntax for this?
 

apsrbstar

Member
Thanks for the quick response, unfortunately, I get:
** Incompatible data types in expression or assignment. (223)
** Could not understand line 13. (196)​
It's line 13 because I added some criteria to restrict the effect to limited records.
 

tamhas

ProgressTalk.com Sponsor
The problem is not the = ? since that works for any data type, so I suspect it is complaining about your trying to assign a string to a date. Look up creating an actual date.
 

LarryD

Active Member
What Thomas is saying is that don't put quotation marks around a date assignment (same as for integers and decimals).

Also, make sure you didn't put quotes around the ? either.

You should do as Thomas suggested and look up in the documentation on how to assign dates etc.
 
Top