I am creating a .XML using file options and when opened file in notepad it has line breaks for longer rows. When line breaks are removed it gives a correct XML file.
I am not sure why it should matter if there are extra line breaks. Those should be irrelevant to the XML format.
Most likely you just did not set a long enough line length. The PUT statement will insert a line break if the current text you are trying to write will make the current line longer than the record length you told it to create.
What value did you use for the LRECL= option on your FILE statement? Set it to something larger, like 10000000.
If that is not long enough then just tell SAS not to write any line breaks by setting RECFM=N. You could always put out some actual CR+LF characters yourself if you want to make the XML more readable for humans.
I am struggling to find a question here?
I am not sure why it should matter if there are extra line breaks. Those should be irrelevant to the XML format.
Most likely you just did not set a long enough line length. The PUT statement will insert a line break if the current text you are trying to write will make the current line longer than the record length you told it to create.
What value did you use for the LRECL= option on your FILE statement? Set it to something larger, like 10000000.
If that is not long enough then just tell SAS not to write any line breaks by setting RECFM=N. You could always put out some actual CR+LF characters yourself if you want to make the XML more readable for humans.
If "very long" is greater than 32000, avoiding breaks is afaik not possible.
else: check linesize-option of the infile-statement.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.