Folks, I wanted to post an outline for a “real” (as opposed to ‘I just gave up’) solution to this issue, in the hope that the next person that has this needs finds these thoughts useful (or more likely, someone on the forum has a more efficient method to offer up).
Caveats:
1. this simple approach requires a single fieldname per line, but should be able to be easily extended;
2. this example also only shows a –TYPE of the new focexec code for demonstration. For actual use, change to –WRITE for your appropriate operating system.
Step One: original procedure-
TABLE FILE Car
PRINT
MODEL
BY
COUNTRY
END
Step Two: grab the qualified field names for your master. REMINDER: if this is using a JOIN structure, be sure to issue the JOIN PRIOR to issuing the CHECK command.
CHECK FILE CAR HOLD
TABLE FILE HOLD
PRINT FIELDNAME
COMPUTE
SNAME/A60=SQUEEZ(60, (SEGNAME||'.'||FIELDNAME), 'A60');
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE HOLD FORMAT ALPHA AS FULLYQ
END
Without the HOLD command, the following output is produced:
COUNTRY ORIGIN.COUNTRY
CAR COMP.CAR
MODEL CARREC.MODEL
BODYTYPE BODY.BODYTYPE
… and so on.
Step Three: run the following code to –READ the original procedure and TYPE out (or –WRITE out, in the real world) a MODIFIED procedure with fully qualified column names.
DYNAM ALLOC DDNAME FEXIN DSNAME X3HK.PDS.FOCEXEC(NONQ) SHR REUSE
-*
-TOPPER
-READ FEXIN, &LINE.A80.
-IF &IORETURN NE 0 THEN GOTO BYBY ;
-SET &TEST = DECODE &LINE (FULLYQ ELSE 1);
-IF &TEST EQ 1 THEN GOTO NOT_OBJECT;
-SET &NEWLINE = DECODE &LINE (FULLYQ ELSE 0);
-TYPE &LINE AS &NEWLINE
-GOTO TOPPER
-NOT_OBJECT
-TYPE &LINE
-GOTO TOPPER
-*
-BYBY
-EXIT
Running the above procedure against the original code (in step three, be sure to change the DYNAM to the appropriate FILEDEF or APP FI for your shop) generates the following output:
TABLE FILE CAR
PRINT
MODEL
AS CARREC.MODEL
BY
COUNTRY
AS ORIGIN.COUNTRY
END
Again, my goal here is just to help out the next person, who doesn’t want to go through this process one column at a time for a lot of different procedures. Yes, this is a lot of work if you just have one focexec with just a few fields; however, I hope that if you have MANY focexecs and MANY columns, that the above will serve as a useful starting point.
Of course, there is always the possibility that IBI will create this feature as an NFR:
SET TITLE=FULLQ UAL
would be my suggestion.
WebFOCUS 8
Windows, All Outputs