STD.File.FileExists with nothor()
I am trying to use nothor() for a simple project() .
Here is my code :
----------------------SNIP---------------------------------------------------
global_newSuperfileLink := global(newSuperfileLink);
newSuperfileLinkCheckLogical := nothor(PROJECT(global_newSuperfileLink,
TRANSFORM(superfile_logicalfile_flat_layout,
SELF.LogicalFileExists := STD.File.FileExists(left.LogicalFile),
SELF := left ))) : INDEPENDENT;
Then I use newSuperfileLinkCheckLogical for rest of the processing …..
----------------------SNIP---------------------------------------------------
This gives me an error : Error: INTERNAL: Expected a parent/container context. Likely to be caused by executing something invalid inside a NOTHOR. (0, 0), 4818,
I just want to check and record if those files actually exist.
Here is my code :
----------------------SNIP---------------------------------------------------
global_newSuperfileLink := global(newSuperfileLink);
newSuperfileLinkCheckLogical := nothor(PROJECT(global_newSuperfileLink,
TRANSFORM(superfile_logicalfile_flat_layout,
SELF.LogicalFileExists := STD.File.FileExists(left.LogicalFile),
SELF := left ))) : INDEPENDENT;
Then I use newSuperfileLinkCheckLogical for rest of the processing …..
----------------------SNIP---------------------------------------------------
This gives me an error : Error: INTERNAL: Expected a parent/container context. Likely to be caused by executing something invalid inside a NOTHOR. (0, 0), 4818,
I just want to check and record if those files actually exist.
- rati
- Posts: 4
- Joined: Wed Oct 23, 2013 2:51 pm
rati,
There is no inherent problem with using STD.File.FileExists inside a NOTHOR. I just tested this code on one of our training clusters and it ran fine:
Perhaps it's an interaction with your use of the GLOBAL function?
HTH,
Richard
There is no inherent problem with using STD.File.FileExists inside a NOTHOR. I just tested this code on one of our training clusters and it ran fine:
- Code: Select all
import Std;
LogicalFile := '~CLASS::RT::Intro::Persons';
NOTHOR(STD.File.FileExists(LogicalFile));
- Code: Select all
import Std;
ds := DATASET([{'~CLASS::RT::Intro::Persons'},
{'~CLASS::RT::Intro::Accounts'},
{'~CLASS::RT::Intro::NoFileForThis'}
],{STRING LogicalFile});
nothor(PROJECT(ds,
TRANSFORM({BOOLEAN LogicalFileExists,STRING LogicalFile},
SELF.LogicalFileExists := STD.File.FileExists(left.LogicalFile),
SELF := left ))) : INDEPENDENT;
Perhaps it's an interaction with your use of the GLOBAL function?
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1619
- Joined: Wed Oct 26, 2011 7:40 pm
Adding few to global() helped.
- Code: Select all
global_newSuperfileLink := global(newSuperfileLink,few);
- rati
- Posts: 4
- Joined: Wed Oct 23, 2013 2:51 pm
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest