BookmarkSubscribeRSS Feed
SGB
Obsidian | Level 7 SGB
Obsidian | Level 7

Hi SSP Experts!

I have a problem with the following code. formattest.HTML looks great, but when I put the same code in SAS it doesnt produce the same output?.

I have attached formattest.html, html output and SAS output.

Can anyone tell me whats the problem with the below code?!

%let stpname=XXX;

data _null_;
  format infile $char256.;
  input;
  infile = resolve(_infile_);
  file print;
  put infile;
cards4;

<FORM ACTION="&URL" METHOD="POST">

<INPUT TYPE="HIDDEN" NAME="_program" VALUE="&stpname"/>
<INPUT TYPE="HIDDEN" NAME="_action" VALUE="EXECUTE"/>

<style type="text/css">
#mystyle {
border:10px solid black;
border-collapse:collapse;
background-color: #CCCCCC;
font-family: "Calibri";

}
#mystyle th {
border:1px solid black;
font-weight: bold;
}
#mystyle th.th1 {
text-align: left;
width: 200px;
}
#mystyle th.rightside {
border:0px;
width: 250px;
}
#mystyle td {
border:1px solid black;
}
#mystyle td.off {
border:0px;
}

input[type=text] {
width: 100px;
background-color: #FFFFFF;
}
</style>

<table id="mystyle">

<tr> <th class="th1">FLIGHT</th>
          <th>4TH QTR</th>
          <th>1ST QTR</th>
          <th>2ND QTR</th>
          <th>3RD QTR</th>
          <td class="rightside"> </td>
</tr>

<tr> <td class="off"> </td>
    <td><input type="text" name="4qStart1" >-<input type="text" name="4qEnd1" ></td>
    <td><input type="text" name="1qStart1" >-<input type="text" name="1qEnd1" ></td>
    <td><input type="text" name="2qStart1" >-<input type="text" name="2qEnd1" ></td>
    <td><input type="text" name="3qStart1" >-<input type="text" name="3qEnd1" ></td>
    <td class="off"> </td>
</tr>

<tr> <td class="off"> </td>
    <td><input type="text" name="4qStart2" >-<input type="text" name="4qEnd2" ></td>
    <td><input type="text" name="1qStart2" >-<input type="text" name="1qEnd2" ></td>
    <td><input type="text" name="2qStart2" >-<input type="text" name="2qEnd2" ></td>
    <td><input type="text" name="3qStart2" >-<input type="text" name="3qEnd2" ></td>
    <td class="off"> </td>
</tr>

<tr> <td class="off"> </td>
    <td><input type="text" name="4qStart3" >-<input type="text" name="4qEnd3" ></td>
    <td><input type="text" name="1qStart3" >-<input type="text" name="1qEnd3" ></td>
    <td><input type="text" name="2qStart3" >-<input type="text" name="2qEnd3" ></td>
    <td><input type="text" name="3qStart3" >-<input type="text" name="3qEnd3" ></td>
    <td class="off"> </td>
</tr>

</table>

</FORM>

;;;;
run;

SGB

4 REPLIES 4
ballardw
Super User

Have you tried specifying an output file instead of file print? Using file print uses some defaults that may not be desirable for html.

SGB
Obsidian | Level 7 SGB
Obsidian | Level 7

I tried using _webout as well! It is not working?!.. Any help to fix this is appreciated.

ballardw
Super User

Did you try something like:

file "c:\path\output.html";

When I used that output it sure looked a lot like your HTML output in the PDF.

zeelan
Calcite | Level 5

Hi ,

You can try this

data _null_;

  format infile $char256.;

  input;

  infile = resolve(_infile_);

  file _webout;

  put infile;

cards4;

<HTML >  code;

;;;;

run;


SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 3241 views
  • 0 likes
  • 3 in conversation