Issue in XML out

Occasional Contributor
Posts: 18

Issue in XML out

Hi People,

I am trying to generate an XML file from one dataset.

No tree structure required.

I am using the below code:

libname stmt xmlv2 "&PATH.\&OUTPUT..xml";

  options  missing='';

  data stmt.StatementSelectivity;

   set Temp_out;


I am able to generate the output xml file

Now problem is, for all numeric blank values in the table , I get sml tags like below:

<OpenValueNumeric_1> </OpenValueNumeric_1>

<OpenValueNumeric_2> </OpenValueNumeric_2>

But for text fields where value is missing it looks something like :

<OpenValueCharacter_3 missing=" " />

<OpenValueCharacter_4 missing=" " />

Marked in red, missing=" " should not be appearing in the output file.

How can i avoid this?

Thanks in advance!

Super User
Super User
Posts: 9,599

Re: Issue in XML out

Posted in reply to skygold16

Not used this myself, but a couple of thoughts.  Could it be the options missing=''; statement is changing the numeric version to be a space on the output?  Try without that.  You could also replace null strings with and actual space, that should then appear as text between tags.  Alternatively you could put a special symbol in, e.g if text="" then text='&quot;&quot;';

Occasional Contributor
Posts: 18

Re: Issue in XML out

Hi RW9,

Thanks for the quick reply.

I used option missing, just to avoid missing = in output file.

Also, there are like 40 columns, I cannot manually put blank or any special symbol for all the columns and it may be against the actual requirements, I mean it may not be accepted by other end system where I am going to load the file..

Ask a Question
Discussion stats
  • 2 replies
  • 2 in conversation