5

We are going to migrate our EG projects (over 1000 projects) to a new environment. In the old environment we use "W-Latin" as encoding on the Teradata database. In the new environment we will start using "UTF-8" as encoding on the Teradata database.
And a lot of other changes which I believe are not relevant for this question.

To prevent data issues we will have to replace functions like REVERSE, etc with KREVERSE, etc We could do this by opening al projects and clicking through it to change the functions in the expression builder.

This would be really time consuming, considering that we have over 1000 .egp files

We already have a code scanner that unzips the .egp file and detects al the use of these functions in the project.xml file.

The next step could be that we find and replace the functions and put the project.xml file back in the .egp file.

Who can tell me how to put the project.xml file back in the .egp file without corrupting the .egp file

Aniel
  • 53
  • 5
  • Hi! What have you tried so far? Zipping the file back up is what I'd start with, have you tried that yet? – Joe Aug 22 '18 at 16:28
  • - unzip the file, adjust the project.xml file manually, replace the old project.xml, zip all the files form the former zip archive, rename the zip file to .egp – Aniel Aug 23 '18 at 08:20

1 Answers1

3

I was able to do this.

tl;dr -- Zip the files back up and change the extension to .egp.

Created a new EG project and added a code node to create sample data:

data test;
do cat = "A", "B", "C";
    do i=1 to 10;
        r = rannor(123);
        output;
    end;
end;
drop i;
run;

I then added a Query node to the output to do a "SUM" of the r column by cat.

Ran the flow and got expected output.

Saved the EG project.

Opened the EG Project in 7zip and extracted the archive to a location.

In project.xml, I found the section for the Query and changed the SUM to MEAN

                        <Expression>
                            <LHS_TYPE>LHS_FUNCTION</LHS_TYPE>
                            <LHS_DMCOLGROUP>Numeric</LHS_DMCOLGROUP>
                            <RHS_TYPE>RHS_COLUMN</RHS_TYPE>
                            <RHS_DMCOLGROUP>Numeric</RHS_DMCOLGROUP>
                            <InFormat />
                            <LHS_String>MEAN</LHS_String>
                            <LHS_Calc />
                            <OutputType>OPTYPE_NOTSET</OutputType>
                            <RHS_StringOne>r</RHS_StringOne>
                            <RHS_StringTwo />
                        </Expression>

Selected the files and added them to an achieve using 7zip. Selected "zip" compression and saved the file with ".egp" extension.

I opened the project in EG and ran the flow. The output was now the MEAN of R and not the SUM.

DomPazz
  • 12,415
  • 17
  • 23
  • 1
    Thnx. We just missed one step. We were using 7z (the default) as zip encoding. By using ".zip" it now is possible to open the SAS EG project. – Aniel Aug 23 '18 at 09:23