Desktop productivity for business analysts and programmers

How to import XML file into SAS EG??

Reply
Contributor
Posts: 34

How to import XML file into SAS EG??

Hi All,

 

I'm trying to import XML file into EG using Assign Library function but couldn't as I couldn't find how to use the file name statement in EG. 

I tried using below code and its working fine but need to convert it into EG tasks.

 

filename Ref "path";
filename SXLEMAP 'path';- created by XML Mapper
libname ref xmlv2 xmlmap=SXLEMAP access=READONLY;  

 

Your help will be really appreciated. Thnaks in advance.

Super Contributor
Posts: 406

Re: How to import XML file into SAS EG??

What have you tried sofar and what happened. Can you provide logs?

 

If your code works outside of EG you could paste it as-is into a program node inside EG and run it from there.

 

Keep in mind: depending on your EG configuration your code inside EG may run on a different server and the files may not exist on that machine. Copy them over if that's the case. Work with your IT staff/SAS support people if needed.

 

Hope this helps,

- Jan.

Contributor
Posts: 34

Re: How to import XML file into SAS EG??

Thanks for your response.

 

The code is working fine in SAS EG but I have to assign library and read the files(Requirement).

I have assigned a library with XML V2 engine and trying to read the file but I could nt read because of the attached Error. 

thanks

 

Super Contributor
Posts: 406

Re: How to import XML file into SAS EG??

Hi,

 

You have to be more precise in explaining what you do when trying to read the datasets. The XML engine is sequential by nature and does not allow for navigating through the rows. So the EG tale viewer may not work. Whatever youdo, keep in mind that the engine may throw up these roadblocks. Your best bet would be to first copy the tables to a SAS library and do your operations on those.

 

Also, what do you mean by


read the files(Requirement).


Is it a requirement hat would prevent you from reading a SAS copy?

 

Regards, Jan.

Contributor
Posts: 34

Re: How to import XML file into SAS EG??

Sorry that I couldn't explain properly. 

My question is how to read the table when I'm getting that error??

It is my client requirement that I shouldn't code, that is the reason I'm using this option of assigning library.

 

Thanks Bharath

SAS Super FREQ
Posts: 271

Re: How to import XML file into SAS EG??

As @jklaverstijn mentioned, the XMLV2 engine is a sequential-only engine.  EG's data grid did not previously support viewing XMLV2 (or XLSX engine data, since also sequential-only).  However, we added support for both of these in EG 7.12 HF2 (Y39002), which you can install via Check for Updates (in EG 7.11 or later, and if your admin allows) or from here:

http://ftp.sas.com/techsup/download/hotfix/HF2/Y39.html

 

Casey

Contributor
Posts: 34

Re: How to import XML file into SAS EG??

I will give it a try. Thanks

Contributor
Posts: 34

Re: How to import XML file into SAS EG??

Sorry Casey. Unfortunately I'm still getting the same error. 

SAS Super FREQ
Posts: 271

Re: How to import XML file into SAS EG??

Hi Bharath,

 

It still isn't clear to me exactly what you are doing that leads to the problem.  Are you running the libname code in your first post then double-clicking the data set in the library in EG's Servers view in an attempt to open it in EG's data grid and then getting the error you posted?

Contributor
Posts: 34

Re: How to import XML file into SAS EG??

[ Edited ]

Since I cannot read those datasets. I'm trying to take copy of it. I  have tried using data builder but there is no visible columns in it.

 

when I'm using code everythings is working fine. 

I used this code :

 

filename Ref "path";
filename SXLEMAP 'path';- created by XML Mapper
libname ref xmlv2 xmlmap=SXLEMAP access=READONLY;  

Ask a Question
Discussion stats
  • 9 replies
  • 733 views
  • 0 likes
  • 3 in conversation