Hi,
On Z/OS Mainframe SAS, I was trying to find a way to create an xml file from the SAS dataset created by pulling DB2 data.
However, I was not successful. Please help.
Thanks,
kyesrao.
What have you tried so far? Which SAS version is available? Check out libname xml.
Hi:
Here's a simple example using just 3 obs from SASHELP.CLASS:
Here's the tip sheet on using the LIBNAME XML engine: https://support.sas.com/rnd/base/xmlengine/XML94tipsheet.pdf
cynthia
Your code runs on the server side which happens to be a Mainframe. A path like C:\Users\b869363\Desktop\CVDOUT.xml is certainly not valid on a Mainframe.
As Cynthia suggested, I did open a track and it helped me generate the XML document even without using an XML schema.
Instead of these 3 statements,
FILENAME OUT 'C:\Users\b869363\Desktop\CVDOUT.xml';
LIBNAME OUT XML92 XMLTYPE=XMLMAP
XMLMAP='C:\Users\b869363\Desktop\CVDexport.map';
I had to code this one line.
LIBNAME OUT XMLV2
where LIBNAME is the reserved word, XMLV2 is the engine name and OUT is the DDNAME assigned to the following dataset.
DD DSN=EI.BAS.TESTXML.D180310,DISP=(,CATLG),
UNIT=SMSDA,SPACE=(CYL,(100,2),RLSE),
DCB=(RECFM=VB,LRECL=80,BLKSIZE=0),RETPD=180
Here is the final output.
<?xml version="1.0" ?>
<TABLE>
<CVDOUT>
<EMEID>0000854192</EMEID>
<MBRID>0000319496</MBRID>
<CVDEDT>2016-09-01</CVDEDT>
<CVDTDT>9999-12-31</CVDTDT>
</CVDOUT>
<CVDOUT>
<EMEID>0000854192</EMEID>
<MBRID>0000854192</MBRID>
<CVDEDT>2016-09-01</CVDEDT>
<CVDTDT>9999-12-31</CVDTDT>
</CVDOUT>
<CVDOUT>
<EMEID>0000854192</EMEID>
<MBRID>0000867758</MBRID>
<CVDEDT>2016-07-01</CVDEDT>
<CVDTDT>9999-12-31</CVDTDT>
</CVDOUT>
</TABLE>
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.