| name | Optional. The identifier for this action. |
| action | The action to execute. |
The NOTHOR compiler directive indicates the action should not execute on thor, but inline instead, in a global context. You can only do very simple dataset operations within a NOTHOR, like filtering records or a simple PROJECT.
NOTHOR needs to be used around operations that use the superfile transactions, (such as the example below) where the compiler does not spot the appropriate context.
Example:
IMPORT STD;
rec := RECORD
STRING10 S;
END;
srcnode := '10.239.219.2';
srcdir := '/var/lib/HPCCSystems/mydropzone/';
dir := STD.File.RemoteDirectory(srcnode,srcdir,'*.txt',TRUE);
//without NOTHOR this code gets this error:
// "Cannot call function AddSuperFile in a non-global context"
NOTHOR(SEQUENTIAL(
STD.File.DeleteSuperFile('MultiSuper1'),
STD.File.CreateSuperFile('MultiSuper1'),
STD.File.StartSuperFileTransaction(),
APPLY(dir,STD.File.AddSuperFile('MultiSuper1',
STD.File.ExternalLogicalFileName(srcnode,srcdir+name))),
STD.File.FinishSuperFileTransaction()));
F1 := DATASET('MultiSuper1', rec, THOR);
OUTPUT(F1,,'testmulti1',OVERWRITE);
See Also: SEQUENTIAL