Your SAS programs, embedded in web apps and elsewhere

Problems with end of line markers when using datalines in stored process

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Problems with end of line markers when using datalines in stored process

Hi all,

I have an open tech support track on this issue, but I thought I'd throw this out here in case anyone else has run into a similar issue.  I have an EG project that has many data inputs, and produces HTML output.  One of the data inputs uses datalines to input static data, and it works perfectly fine in EG but produces errors when I convert the project into a stored process.  I eventually narrowed down the issue to an anomaly where the datalines text is truncated in the stored process (but not EG), thereby causing long lines to go to the next line and act like a new row of text.

Does anyone know if stored processes have a length limitation where the datalines rows cannot exceed a certain length?

I've attached part of the original code, along with part of the stored process code, to show what is happening.  You can see where some lines are moved to the next line in the stored process code (e.g., for the first entry, the words " with this.Software Limitation" are moved down rather than continuing from the previous line).

I am running EG 4.2 on SAS 9.2 on a Linux server.

Any suggestions would be greatly appreciated.

Thank you!

Message was edited by: Pearl OConnor Edited to remove attachments.


Accepted Solutions
Solution
‎07-22-2013 10:44 AM
PROC Star
Posts: 1,322

Re: Problems with end of line markers when using datalines in stored process

Hi,

I'm confused.  How are you creating the stored process?  Are you using the stored process wizard in EG and pasting code into it?  It looks like whatever is generating your stored process code is adding the line breaks you don't want.

It's possible there is a line size limit to the wizard, but I wouldn't think there would be a line size limit to stored processes themselves.

One option would be instead of having all of your code in the stored process source code, leave it in a .sas file on the server.  Then have the stored process source code %include the .sas file.  I described that approach in a blog post.

Or you could always open the stored process source code after it has been generated by the wizard, and edit it directly to remove the breaks you don't want.

HTH,

--Q.


View solution in original post


All Replies
Solution
‎07-22-2013 10:44 AM
PROC Star
Posts: 1,322

Re: Problems with end of line markers when using datalines in stored process

Hi,

I'm confused.  How are you creating the stored process?  Are you using the stored process wizard in EG and pasting code into it?  It looks like whatever is generating your stored process code is adding the line breaks you don't want.

It's possible there is a line size limit to the wizard, but I wouldn't think there would be a line size limit to stored processes themselves.

One option would be instead of having all of your code in the stored process source code, leave it in a .sas file on the server.  Then have the stored process source code %include the .sas file.  I described that approach in a blog post.

Or you could always open the stored process source code after it has been generated by the wizard, and edit it directly to remove the breaks you don't want.

HTH,

--Q.


Occasional Contributor
Posts: 10

Re: Problems with end of line markers when using datalines in stored process

Hi Quentin,

Thanks so much for your suggestions!  I was able to solve the issue by storing the static code on the server in a .sas file and then using %include.  I had tried creating the stored process directly from the EG project using the wizard, and also by creating a new SP in EG from a blank project then pasting in the code, but no luck.  I didn't want to have to go into the SP and manually remove the line breaks, because there are over 9000 lines of code (don't ask - not my choice!).

So using the %include method works nicely.  Thanks again for your suggestions!

Have a wonderful day,

Pearl

Occasional Contributor
Posts: 10

Re: Problems with end of line markers when using datalines in stored process

Oops, I spoke too soon.  The %include method eliminated the problem of the datalines text getting truncated to the next line, but they're still getting truncated and the final field values aren't getting picked up.  Weird.  Looks like it may be something to do with informats or datalines options.  But, at least I've eliminated one of my issues.  Now to track down the needle in the haystack.

Super User
Super User
Posts: 7,042

Re: Problems with end of line markers when using datalines in stored process

Did you include the LRECL option on the %INCLUDE statement?  One of your variables is defined as being 1032 characters long!!

%include 'EG Code.txt'  / source2 lrecl=3000 ;

Occasional Contributor
Posts: 10

Re: Problems with end of line markers when using datalines in stored process

Hi Tom,

Thank you so much for your suggestion!  You were correct - once I added that LRECL option to the %include statement, the output returned the correct values for each line.

Thanks again!

Pearl

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 1753 views
  • 3 likes
  • 3 in conversation