Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only. Moving forward, myibi is our community platform to learn, share, and collaborate. We have the same Focal Point forum categories in myibi, so you can continue to have all new conversations there. If you need access to myibi, contact us at myibi@ibi.com and provide your corporate email address, company, and name.


Connect to myibi
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     MODIFY how to update an A1 field with a blank

Read-Only Read-Only Topic
Go
Search
Notify
Tools
MODIFY how to update an A1 field with a blank
 Login/Join
 
Expert
posted
Does anyone know how to MODIFY a file
with an UPDATE command when the field to be updated is to receive a blank value?
i can't seem to make it work.
i'm using fixform from a file, and the blanks are in the file ok.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Susannah,

In your MODIFY, add a COMPUTE statment something like the one in this example:

-*-- Create test hold file ---
TABLE FILE EMPDATA
PRINT
COMPUTE MIDINITIALX/A1 = IF MIDINITIAL EQ 'C' THEN ' ' ELSE MIDINITIAL; AS 'MIDINITIAL'
BY PIN
WHERE MIDINITIAL EQ 'A' OR 'C'
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS EMPH001 FORMAT ALPHA
END
-RUN

-*-- Modify data (even if blank) ---
MODIFY FILE EMPDATA
FIXFORM FROM EMPH001
MATCH PIN
-* Force blank update
ON MATCH COMPUTE MIDINITIAL = IF MIDINITIAL EQ ' ' THEN ' ' ELSE MIDINITIAL;
ON MATCH UPDATE MIDINITIAL
ON NOMATCH REJECT
DATA ON EMPH001
END
-RUN
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
thanks francis, very much. that works like a charm.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
Working the late shift?
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
FIXFORM FROM holdname
issues conditional fixforms. (You can see that in the error message issued when the hold master includes fields that are undefined to the Modify).

If a conditional field is blank in the transaction record, the field value is set to blank (or zero), but the field is not marked 'active' -- i.e., it is not set to update the database field. The activate it, add either
COMPUTE fieldname=fieldname;
or
ACTIVATE RETAIN fieldname
after the FIXFORM.

Or use MAINTAIN, where the concept of activation does not exist.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
ah. thanks for the insight, Jack. makes sense.
yep, francis, working way too late. Wink
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Virtuoso
posted Hide Post
FIXFORM FROM holdname
issues conditional fixforms. (You can see that in the error message issued when the hold master includes fields that are undefined to the Modify).

If a conditional field is blank in the transaction record, the field value is set to blank (or zero), but the field is not marked 'active' -- i.e., it is not set to update the database field. To activate it, add either
COMPUTE fieldname=fieldname;
or
ACTIVATE RETAIN fieldname
after the FIXFORM.

Or use MAINTAIN, where the concept of activation does not exist.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     MODIFY how to update an A1 field with a blank

Copyright © 1996-2020 Information Builders