Tue Aug 20, 2019 4:04 pm
Login Register Lost Password? Contact Us


Parsing an ECL file

Questions around writing code and queries

Tue Jul 23, 2019 7:46 pm Change Time Zone

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?
janet.anderson
 
Posts: 32
Joined: Wed Jul 17, 2013 5:31 pm

Tue Jul 23, 2019 8:18 pm Change Time Zone

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
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1472
Joined: Wed Oct 26, 2011 7:40 pm

Tue Jul 23, 2019 8:59 pm Change Time Zone

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: 32
Joined: Wed Jul 17, 2013 5:31 pm

Tue Jul 23, 2019 9:44 pm Change Time Zone

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
rtaylor
Community Advisory Board Member
Community Advisory Board Member
 
Posts: 1472
Joined: Wed Oct 26, 2011 7:40 pm

Wed Jul 24, 2019 1:05 pm Change Time Zone

Thanks, Richard.
janet.anderson
 
Posts: 32
Joined: Wed Jul 17, 2013 5:31 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron