Parsing an ECL file
There is an ECL file in my repository that has a series of statements that assign a source description to a source code like:
export src_ABC := 'AB';
I run some stats grouped by the source codes in the ECL file, and I want to include the source description. So I would like to create a lookup table using the file (this is a living file, it changes, I shouldn't be hard coding anything). Is there a way to use PARSE on an ECL file in a repo? Is there a better way to go about this?
export src_ABC := 'AB';
I run some stats grouped by the source codes in the ECL file, and I want to include the source description. So I would like to create a lookup table using the file (this is a living file, it changes, I shouldn't be hard coding anything). Is there a way to use PARSE on an ECL file in a repo? Is there a better way to go about this?
- janet.anderson
- Posts: 33
- Joined: Wed Jul 17, 2013 5:31 pm
Janet,
Since an ECL code file is just a UTF8 text file, you can certainly use PARSE on it. But the real issue is getting to it.
It's easy if you are NOT using an old-school, pre-Open Source, central repository, because that means it's just a file on your local hard drive, and you can do anything you want with it. But, if you are using a central repository (a MySQL database to anybody not inside Lexis Nexis) then I have no idea how you can get to that,
HTH,
Richard
Since an ECL code file is just a UTF8 text file, you can certainly use PARSE on it. But the real issue is getting to it.
It's easy if you are NOT using an old-school, pre-Open Source, central repository, because that means it's just a file on your local hard drive, and you can do anything you want with it. But, if you are using a central repository (a MySQL database to anybody not inside Lexis Nexis) then I have no idea how you can get to that,
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1488
- Joined: Wed Oct 26, 2011 7:40 pm
Thanks, Richard. I am using git, so I do have the file locally. However, the IDE already knows where the file is and what it's contents are, so is there a way to avoid having to spray it and then read it as a dataset (like I would for a typical text file)? I'm trying to automate a reporting process to be a one click BWR, so is there a sleek way to do this?
- janet.anderson
- Posts: 33
- Joined: Wed Jul 17, 2013 5:31 pm
Janet,
The problem is that, although the IDE knows about the file, you're going to be running that PARSE on a Thor (or hThor) so to make the file available in the cluster you have to be able to define it as a DATASET in your ECL code.
If you can configure your environment to use the machine where your code lives as a Landing Zone (or automate some process to put it on an LZ every time it's updated), you could then define the ECL code file as a Landing Zone file (see the "Scope and Logical Filenames => Landing Zone Files" section in the ECL Language Reference) and then you can PARSE it.
HTH,
Richard
The problem is that, although the IDE knows about the file, you're going to be running that PARSE on a Thor (or hThor) so to make the file available in the cluster you have to be able to define it as a DATASET in your ECL code.
If you can configure your environment to use the machine where your code lives as a Landing Zone (or automate some process to put it on an LZ every time it's updated), you could then define the ECL code file as a Landing Zone file (see the "Scope and Logical Filenames => Landing Zone Files" section in the ECL Language Reference) and then you can PARSE it.
HTH,
Richard
- rtaylor
- Community Advisory Board Member
- Posts: 1488
- Joined: Wed Oct 26, 2011 7:40 pm
Hi Janet,
Just noticed your post, there is an obscure way to access ECL.
Just use a SOAPCALL on:
Requesting just
to get the ECL back in the SOAP response.
Actually trivial to implement, but a bit 'round the houses'.
Yours
Allan
Just noticed your post, there is an obscure way to access ECL.
Just use a SOAPCALL on:
- Code: Select all
STD.File.GetEspUrl()/WsWorkunits/WUInfo
Requesting just
on an old workunit (its WUID is a parameter)IncludeECL
to get the ECL back in the SOAP response.
Actually trivial to implement, but a bit 'round the houses'.
Yours
Allan
- Allan
- Posts: 386
- Joined: Sat Oct 01, 2011 7:26 pm
Janet,
If you think about it, under the hood the IDE is just one huge set of SOAPCALLS.
Anything you see in the IDE or can manipulate in the same, you can do programmatically and, as you want to do, implement additional functionality not shipped as standard by LN.
Cheers
Allan
If you think about it, under the hood the IDE is just one huge set of SOAPCALLS.
Anything you see in the IDE or can manipulate in the same, you can do programmatically and, as you want to do, implement additional functionality not shipped as standard by LN.
Cheers
Allan
- Allan
- Posts: 386
- Joined: Sat Oct 01, 2011 7:26 pm
Janet,
Thinking on about this, you could run 'Fiddler'
https://www.telerik.com/download/fiddler
Run it while logging in on the IDE and you will find out the HTTP request/responses the IDE is doing to attach to your particular code repository.
You then just have to reproduce those in your code to get the ECL file you want to parse directly without having to look-up old workunits, which, frankly, is Mad Hatter party time.
I hope this helps.
Allan
Thinking on about this, you could run 'Fiddler'
https://www.telerik.com/download/fiddler
Run it while logging in on the IDE and you will find out the HTTP request/responses the IDE is doing to attach to your particular code repository.
You then just have to reproduce those in your code to get the ECL file you want to parse directly without having to look-up old workunits, which, frankly, is Mad Hatter party time.
I hope this helps.
Allan
- Allan
- Posts: 386
- Joined: Sat Oct 01, 2011 7:26 pm
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: MSN [Bot] and 1 guest