Your SAS programs, embedded in web apps and elsewhere

There is a space appearing where i dont want one.

Reply
Regular Contributor
Posts: 229

There is a space appearing where i dont want one.

Hello,

I'm using a stored process to create an HTML file, i want to place a row with a link like this:

if first.lot_id then put ''Lot_id' Priority: ' Lot_priority '
';
run;



the result in the HTML file generates:


AL100379/1 Priority: 2

AL100402 Priority: 2

AL100403 Priority: 2


as you can see there is always a space after the number in the url. I tried trim, strip or compress but i think the problem is situating in the quoting of my string. Any help?

Message was edited by: Filipvdr

Message was edited by: Filipvdr

Message was edited by: Filipvdr Message was edited by: Filipvdr
Regular Contributor
Posts: 229

Re: There is a space appearing where i dont want one.

can somebody tell me how i can put the code here without it generating HTML?
SAS Super FREQ
Posts: 8,744

Re: There is a space appearing where i dont want one.

Hi:
In order to post code, protect > and < symbols, preserve code formatting and output indention and to otherwise learn how to post special symbols to the forum, refer to this previous forum posting. It talks about the LT and GT symbols and also discusses how to emphasize code and how to surround code snippets with [pre] and [/pre] (as you discovered
 do not preserve code formatting).
http://support.sas.com/forums/thread.jspa?messageID=27609毙

cynthia
Regular Contributor
Posts: 229

Re: There is a space appearing where i dont want one.

i still get :

[pre]

<a href="AL100379 ">AL100379 </a> Priority: 2 <br/><a href="AL100379 ">AL100379 </a> Priority: 2 <br/><a href="AL100379 ">AL100379 </a> Priority: 2 <br/>
[/pre]

and as you can see, after the number is still a space and i used the following code:
[pre]

if first.lot_id then do;
Lot_id='AL100379';
Lot_priority=2;
put '<a href="' lot_id '">' Lot_id '</a> Priority: ' Lot_priority '<br/>';
/* put line;*/
end;

[/pre]

Message was edited by: Filipvdr Message was edited by: Filipvdr
SAS Employee
Posts: 285

Re: There is a space appearing where i dont want one.

The first PUT statement in my posting illustrates the problem, and the second one illustrates the solution. Try using the second format.

Vince DelGobbo
SAS R&D
Regular Contributor
Posts: 229

Re: There is a space appearing where i dont want one.

Oh sorry, i didn"t understand. But yes yes, this works, thanks a lot!
SAS Employee
Posts: 285

Re: There is a space appearing where i dont want one.

Does this DATA Step code illustrate the problem and solution?

[pre]
data _null_;
Lot_id='AL100379';
Lot_priority=2;
put '<a href="' lot_id '">' Lot_id '</a> Priority: ' Lot_priority '<br/>';
put '<a href="' lot_id +(-1) '">' Lot_id +(-1) '</a> Priority: ' Lot_priority +(-1) '<br/>';
run;
[/pre]

Vince DelGobbo
SAS R&D
Ask a Question
Discussion stats
  • 6 replies
  • 352 views
  • 0 likes
  • 3 in conversation