My apologies. Here is the is the full code. proc printto new log='/sas/config/Lev1/SASApp/SASEnvironment/SASCode/Edit_Company.log'; libname National '/vol2/mars/national'; /* %macro extract_id(value); %let id = %scan(&value, -1, _); %put The extracted id is: &id; %mend extract_id; */ /* Example usage */ /* * %extract_id(AAP_REQUEST_123); */ /* Utilize the parameter */ proc sql noprint; select Companyname into :CompanyName from National.Company where id = &id; quit; %let EscapedCompanyName = %sysfunc(tranwrd(%sysfunc(dequote("&CompanyName.")), "'", "''")); /* Assign the value of the escaped Companyname to a new variable */ %let EscapedCompanyName = %sysfunc(tranwrd(%sysfunc(dequote("&CompanyName.")), "'", "''")); /* Assign the value of the escaped Companyname to a new variable */ %let EscapedValue = &EscapedCompanyName; data _null_; file _webout; put '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'; put '<html>'; put '<head>'; put '<title>National Accounts Oneline Program</title> '; put '<meta name="Author" content="Crystal">'; put '<meta name="Description" content="National Accounts Oneline Program">'; put '<link rel="stylesheet" type="text/css" href="S:\Workgroups\SC Marketing\SCS Marketing Services\System Support (soco Read Only Access)\Load Research\LR ART\main_style.css">'; put '</head>'; put '<body>'; put '<div id="container_fullmain">'; put ' <div id="header" align=center><strong>Edit Company</strong></div>'; put ' '; put '<div align=Center>'; put " <a href='https://&trimmed_url./SASStoredProcess/do?_PROGRAM=/Stored_Processes/csg/Oneline_home'>Home</a></p>"; put '</div>'; put ' <div id="container_wide">'; put ' <form name="oneline" method=put ACTION="/SASStoredProcess/do">' ; put '<table>'; put ' <tr> '; put ' <th>Name of company:</th> '; put ' <td> '; put " <INPUT TYPE='Text' NAME='CompanyName' width='50' value=""" "&EscapedValue.""" maxlength='100'><br>"; put " <INPUT TYPE='hidden' NAME='id' width= '50' value=""&id"" maxlength='100'><br>"; put ' </td> '; put ' </tr>'; put ' <tr> '; put ' <th></th> '; put ' <td> '; put ' <input type="hidden" name="_program" value="/Stored_Processes/csg/Edit_Company_Action">'; put ' <input type="submit" value="Edit Company" class="goButton_long">'; put ' </td> '; put ' </tr>'; put ' ' ; put ' ' ; put ' <br>'; put ' <center></center>'; put ' </FORM>'; put ' </div>'; put ' </div>'; put '</div> '; put '</body> '; put '</html> '; run;
... View more