BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
akash1088
Obsidian | Level 7

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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. 

View solution in original post

4 REPLIES 4
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I am struggling to find a question here?

akash1088
Obsidian | Level 7
So basically my requirement is to create a xblr file.
So I am creating xblr file with the help of put statement and giving file extension is .XML and some of the line in that file is very long due to that it is truncate in next line and we are getting some error to solve this issue we are manually making changes in that truncate line.
so is there any options or method to resolve this issue.

Previously I also face this issue(while creating.txt file) but with the help of termstr=crlf and that issue got solved.
Tom
Super User Tom
Super User

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. 

andreas_lds
Jade | Level 19

If "very long" is greater than 32000, avoiding breaks is afaik not possible.

else: check linesize-option of the infile-statement.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 746 views
  • 2 likes
  • 4 in conversation