ࡱ> w@( / 00DTimes New Roman̳0~0DArialNew Roman̳0~0" DArial Blackman̳0~0"0DCourier Newman̳0~01  @n?" dd@  @@`` @9   8&  " $ ' #%  !./0 19*-   +,()234567: 0e0e    f3f3 Ad@ A5% 8c8c     ?1 d0u0@Ty2 NP'p<'pA)BCD|E|| Af3̙ݻ$$%%@pqrT <4!d!dg4dd~0&%dppp@ <4BdBd&%g4:d:d~0p@ pp0___PPT10 ___PPT9l/ 0{A083 ? $O =#1<SAS/AF and Internet Explorer"! SAS/AFzFull featured Object orientated Very capable lack latest developments Frames are input forms Can host ActiveX components l   { Web pages   lBrowsers use latest standards Cascading Style Sheets (CSS) Scripting Contain input forms
...
$ZZ mN$Why use a web page mDesigner pool Use of latest standards Development using production forms Interception Flying under the radar >VV nInternet ExplorerEver present in Windows systems ActiveX feature Microsoft Web Browser component Voila! SAS/AF should be able to use Microsoft Web Browser60!:0!:  HTML Forms    Inputs (parameters) transmitted to server Name=Value pairs Tranmission types GET pairs part of URL POST pairs sent  behind the scenes **  ActiveX components ~Have methods Have properties Fire events User of component can install event handler that gets invoked when an event is fired.0)V)U  Microsoft Web Browser Navigate method render page at URL BeforeNavigate2 event gives access to component prior to actual transmission Variables passed to handler URL (GET parameters) POST (buffer)S#4#   SAS/AF Frame   Version 6 Objects OLE - Insert Object Create Control Microsoft Web Browser Insertable? (see SN-015762) Configure so BeforeNavigate2 runs MSBRWSEH.SCL/"  / MSBRWSEH.SCL   BN2: public method pDisp:num Url:char(1024) Flags:char(1024) TargetFrameName:char(1024) PostData:num Headers:num Cancel:num ; put 'BeforNavigate2 event handler'; put pDisp=; put Url=; put Flags=; put TargetFrameName=; put PostData=; put Headers=; put Cancel=; endmethod;  u4ERROR /OLE: One of the parameters is not a valid type.00 0v3BeforeNavigate2 ByVal pDisp As Object, _ ByRef Url As Variant, _ ByRef Flags As Variant, _ ByRef TargetFrameName As Variant, _ ByRef PostData As Variant, _ ByRef Headers As Variant, _ ByRef Cancel As Boolean@ o5 7  Now what?   Microsoft Web Browser Not directly useable Need an adapter Mediate special type issues of ActiveX in SAS Simple design for specific useNMM  Adapter Design Navigate to a page Signal when new page is to be navigated to Retrieve GET and POST URL property OnBeforeNavigate event GetCount, GetName[index], GetValue[index] PostCount, PostName[index], PostValue[index]$yV  OCX Development Borland Delphi 2006 Professional OleObjectForSasAf.ocx Add form AfWebBrowser Add properties and event Delphi source at http://www.devenezia.com Install regsvr32 OleObjectsForSasAf.ocxH7Y 7Y    Simple Frame   AFBROWSER.FRAME Contains only AfWebBrowser AFBRWSEH.SCL run by event map Caller passes in URL and SCL list to receive inputs Frame exits at first navigation attempt (i.e. submit button)Nqq z7AFBROWSER.FRAME  entry inUrl:input:char outParameters:update:List; init: declare Object oBrowser; _frame_._getWidget ('Browser', oBrowser); rc = setNitemL (oBrowser, {}, 'GET'); rc = setNitemL (oBrowser, {}, 'POST'); oBrowser._setProperty('URL', inURL); return; |8AFBROWSER.FRAME  Browser: browserCount + 1; if browserCount = 1 then return; if listlen (outParameters) >= 0 then do; get = getNitemL (oBrowser, 'GET'); post = getNitemL (oBrowser, 'POST'); rc = setNitemL (outParameters, get, 'GET'); rc = setNitemL (outParameters, post, 'POST'); end; * after capturing the data, shut down the browser frame; * callee is responsible for deleting the SCL lists it receives upon return; call execcmd ('CANCEL'); return; Z+ AFBRWSEH.SCL   ^OBN: public method; /* _self_ is an * OLE - Insert Object that contains an AfWebBrowser * presume _self_ already has two attached lists named * GET and POST, for storing the inputs */ Get = GetNitemL (_self_, 'GET', 1,1,0); Post = GetNitemL (_self_, 'POST', 1,1,0); rc = clearlist (Get); rc = clearlist (Post); declare char(200) name value ;_ _ _y5 AFBRWSEH.SCL   $* Copy GET parameters to SCL list; _self_._getProperty('GetCount', count); do i = 1 to count; * Fetch pair from OLE object; _self_._getProperty('GetName', i-1, name); _self_._getProperty('GetValue', i-1, value); * Store pair in SCL list; rc = insertC (Get, value, -1, name); end;H - $ %{6 AFBRWSEH.SCL   * Copy POST parameters to SCL list; _self_._getProperty( PostCount', count); do i = 1 to count; * Fetch pair from OLE object; _self_._getProperty('PostName', i-1, name); _self_._getProperty('PostValue', i-1, value); * Store pair in SCL list; rc = insertC (Post, value, -1, name); end; * force program flow through object label in frame SCL; _self_._objectLabel(); R / O { {[,GetWebInput.scl   Test Unit 9!Web Inputs to SAS Table Callable from Base Uses macro variables to pass parameters to SCL code Code raise a window with the web form rendered via Microsoft Web Browser ensconced in Adapter. SCL code invoked using Proc DISPLAY@G_$G_# ;"CaptureInput.scl  init: declare List input = {}; call display ( 'AFBROWSER.FRAME' , symget('CaptureUrl') , input );  }9CaptureInput.scl  Z ds = open (symget('CapturedData'), 'N'); rc = newvar (ds, 'Type', 'C', 4); rc = newvar (ds, 'Name', 'C', 50); rc = newvar (ds, 'Value','C', 300); ds = close (ds); ds = open (symget('CapturedData'), 'U'); call PutVarC (ds,1,'URL'); call PutVarC (ds,2,''); call PutVarC (ds,3,symget('CaptureUrl')); rc = append (ds,'NOINIT');$[Z [~:CaptureInput.scl   call PutVarC (ds,1,'GET'); list = GetNItemL (input,'GET',1,1,0); if list then do i = 1 to listlen(list); call PutVarC (ds,2,NameItem(list,i)); call PutVarC (ds,3,GetItemC(list,i)); rc = append (ds,'NOINIT'); end; ;CaptureInput.scl  n call PutVarC (ds,1,'POST'); list = GetNItemL (input,'POST',1,1,0); if list then do i = 1 to listlen(list); call PutVarC (ds,2,NameItem(list,i)); call PutVarC (ds,3,GetItemC(list,i)); rc = append (ds,'NOINIT'); end; ds = close(ds); return;oo o  Conclusion  SAS/AF is alive and kicking Has issues with variants ActiveX adapters can smooth integration Frame hosted web browser Great tool for getting inputHAA <About the AuthorRichard A. DeVenezia Independent Consultant 9949 East Steuben Road Remsen, NY 13438 (315) 831-8802 richard.contact@devenezia http://www.devenezia.com/contact.php http://www.devenezia.com/papers/nesug-2006/8n /&'*+,-. 0 1 2 3 8:<=P$w-x./013 ` ̙33` ` ff3333f` 333MMM` f` f` 3>?" dd@,|?" dd@   " @ ` n?" dd@   @@``PR    @ ` ` p>>  H(    6{ P { T Click to edit Master title style! !  0{  { RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S  # lf3Ayd?l|   TAf3d?+&Z  BAf3yd޽h ? ̙33 Default Design[   P}( Њ@ X@   6 p { T Click to edit Master title style! !  0  `    W#Click to edit Master subtitle style$ $  # lf3Ayd?lZ  BAf3yd޽h ? ̙33  ` fffff` ?̙ffE` ff333` C3ff3` &u3` ffff` **@fff̙fl` +3[Xd` 333f` 5D`|f>?" dd@*?lPd@ `F `A@`<``( n?" dd@   @@``PP   @ ` `.p>> p i(  "T ```  ```""  BĐG pP`` <  "B  C $BCE6FGIQSTUV.WX@` B C `` :  "hB  s *DԔ"  0 {4  T Click to edit Master title style! !"$  0D   RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S"  6 ` `  e*" "  #" `   6 `   g*$ "  #" `   6d ` `  g*$ "  #" `H  0޽h ? fffff___PPT10i. +D=' = @B +  Radial       (  T H X   H X ""  <pX  <  "  BD>H0 <  "B  C BCE6FGIQSTUV.WX@` B C h  :  "B  s *Dpp,$ 0"  0d py  T Click to edit Master title style! !"  0$ x   W#Click to edit Master subtitle style$ $"   6 ` `  e*" "  #" `   6 c   g*$ "  #" `   6D ` `  g*$ "  #" `H  0޽h ? fffff80___PPT10.  0 04(  4 4 H ?P    Y*  4 H$ ?    [* p 4 0 ?  . 4 H ? @  RClick to edit Master text styles Second level Third level Fourth level Fifth level!     S 4 H ?`P   Y*  4 HD ?`   [* H 4 0޽h ? ̙3380___PPT10. ׳X @ (    l  C p    Zgֳgֳ ?P   PRichard A. DeVenezia $Z  BAf3yd޽h ? ̙33   ( Њ@0j@ l  C DP   l  C 4\   H  0޽h ? ̙33  ( @ l  C \ P   l  C T]    H  0޽h ? ̙33 $ <$(  <r < S ^ P   r < S t^    H < 0޽h ? ̙33  ( Ȉ@0h@ l  C 4_ P   r  S _     H  0޽h ? ̙33   (  l  C T` P   l  C `    H  0޽h ? ̙33   @P$( @ Pr P S a P   r P S 4b    H P 0޽h ? ̙33  `$$(  $r $ S c P   r $ S d    H $ 0޽h ? ̙33  D$( @ Dr D S e P   r D S e    H D 0޽h ? ̙33   0( @ Z@ r  S f P   ~  s *g ݻ `   H  0޽h ? ̙33 . $(  r  S .uP  u r  S .u u H  0޽h ? ̙33 - 3( w r  S 0uP  u ~  s *t0uݻ   u   00u P  QVariant corresponding to PostData can not be mapped to a SAS type, thus the ERRORRQ RH  0޽h ? ̙33  $( ~ r  S 1uP  u r  S T2u u H  0޽h ? ̙33    H$( @ Hr H S 3uP   r H S t3uP   H H 0޽h ? ̙33\    @L( @ Lr L S 5uP   r L S 6u   pB L HD?` H L 0޽h ? ̙33  `,$(  ,r , S 7uP   r , S 7u   H , 0޽h ? ̙33P  ( w r  S 9uP     s t9u0e0eݻ    H  0޽h ? ̙33P  (  r  S uP     s u0e0eݻ   H  0޽h ? ̙33J  t( w tl t C uP    t s tu0e0eݻ   H t 0޽h ? ̙33P  ( Cz r  S uP     s Tu0e0eݻ   H  0޽h ? ̙33P  ( w r  S uP     s 4u0e0eݻ   H  0޽h ? ̙33  x8(  xr x S TuP   r x S u`    x 6uݻ 0` \init: declare List input = {}; call display ( 'AFBROWSER.FRAME , 'http://www.devenezia.com/papers/nesug-2006/Payments.html , input ); call putlist (input,'',0); return; H x 0޽h ? ̙33  $(  r  S tuP   r  S u w H  0޽h ? ̙33P   ( 0~@d r  S uP  w   s u0e0eݻ  w H  0޽h ? ̙33P /  (  r  S TewP  w   s ew0e0eݻ  w H  0޽h ? ̙33P 0 @( w r  S hwP  w   s iw0e0eݻ  w H  0޽h ? ̙33P 1 `(  r  S kwP  w   s lw0e0eݻ  w H  0޽h ? ̙33  ($(  (r ( S nwP  w r ( S ow w H ( 0޽h ? ̙33 3  $( w r  S P   r  S d  H  0޽h ? ̙33f 0 &8(  8R 8 3 4   $ 8 C 4 @   Hello, I am Richard DeVenezia and I will be your javaobj guide for the next hour. First, by a show of hands, how many people have used java and / or java objects in SAS before.H 8 0޽h ? ̙33^ 0 (  R  3 4     C _ 4 @   >Type: Number Char JavaObj Hash HIter - hash iterator$?6  H  0޽h ? ̙33  0 |t ( (Ɉaa, R  3 4   z  C Tf 4 @   This is a pattern very familiar to java programmers who develop javabeans. Rarely if ever would a class have public fields. The bean pattern uses methods known as getters and setters to access the fields and is tailored for integration with advanced GUI development tools. Coding patterns are a matter of personal style, but are sometimes dictated to you by management. Whatever the situation, consistency of style makes dealing with large amounts of code easier.,@ ]%H  0޽h ? ̙33 0 p*(  R  3 4     C T8u4 @   8$If you edit a java source and recompile it, after the class has been used during a SAS session, then SAS must be restarted to recognize the changed class. This  problem can occur early in the development cycle, during a debugging cycle or during a rapid enhancement cycle.H  0޽h ? ̙33f 0 &p(  @~@ R  3 4   $  C d 4 @   |- Location can be a folder or jar file. Jar can be thought of as a special or compressed folder that exists within a single file. Jars can contain any type of file, including other jars. The CLASSPATH can list multiple locations by separating them with semicolons. The order listed is the order searched when java looks for classes (important if a class is in more than one jar (I.e. you might list development in front of a production jar when working on a class) The concept of a SAS catalog is similar to a one-level jar, something that contains other things. All the object in the ava Runtime Library are implicitly available,9*H  0޽h ? ̙33h 0 ( 0(  @~@ R  3 4   &  C ta 4 @   There are a multitude of java development tools out there, including SAS Web/AF, but for javaobj programming you might do fine with the freely available software development kit.H  0޽h ? ̙33 0 G(  R  3 4     C ] 4 @   UAJavaobj is not available to the macro facility not to SAS/AF SCL.H  0޽h ? ̙33c  0 #0( @ Z@ R  3 4   !  C 4u4 @    Pattern Types: String = Char, Double = Numeric, Object = javaobj of same Class Correspondence Signature of invocation (SAS) must match signature of declaration (Java) Errors Class not found, constructor signature mismatch or exception thrown ERROR: An error has occurred during class method OM_NEW(3) of "DATASTEP.JAVAOBJ". Method not found or signature mismatch ERROR: Could not find method getLastName at line 4 column 3. ERROR: An error has occurred during instance method OM_CALLSTRINGMETHOD(3278) of "DATASTEP.JAVAOBJ". D`'`GICR'H  0޽h ? ̙33J 0  (  X  C 4   u  S g 4 @  u If java class Z is in a package A.B.C, the class in the declare statement is  A/B/C/Z . Each entry specified in the CLASSPATH is searched for relative path A/B/C, first one found is instantiated.H  0޽h ? ̙336  0 P(  R  3 4     C 6u4 @   * Type is one of Void, Double, String, Boolean, Short, Byte, Long, Float, Int. Except for String, the Type corresponds to Java primitive types and not their analog object versions. obj is a SAS variable of type JavaObj return is a SAS variable of type character or numeric, objects can not be returned. Type can also be static Type ... in which case access is obj.callStatic& or obj.[get|set]StaticTypeaL"9  Jj  H  0޽h ? ̙33 0 j(  R  3 4     C \ 4 @   xBIf you don t know what java is you may have been living under a rock for the last few years. The foundations of java are very much like the foundations of SAS. q,H  0޽h ? ̙33  0 \TP(  R  3 4   Z  C Tc 4 @   What happens to javaobjs when a DATA Step ends ? Do they live on ? No. You must be careful to delete javaobjs, especially if you utilize them heavily. If you don t your SAS session may run into memory usage problems.,MmH  0޽h ? ̙33  0 RJ(  L| X  C 4   uJ  S 2u4 @  u JDBC driver classes implement standard methods that to provide access to database. A Java class that works with databases does not have to be changed when connecting to a different database; only the connection parameters need to be changed (parameters can be often specified in a login dialog or configuration file, should not be hard-coded). A JDBC driver is implemented in or more Java classes and is most often deployed or distributed as one or more jar files.H  0޽h ? ̙33! 0 wo(  ? X  C 4   wo  S u4 @  w RMI stands for remote method invocation; allowing a class or object in one VM interact with a class or object in a different VM . A wrapper class is one that perform java related tasks that SAS javaobj cannot. Such as dealing with an object returned from a method. Another case for needing a wrapper is when a java method requires a type that SAS cannot provide. SAS can only pass strings and doubles; so when a method needs something other than a double, you will need to write a wrapper class to allow the javaobj to perform the task at hand. The wrapper class would perform the necessary type casting to convert a double to an int, long, float, etc... Remember, a javaobj can only be created by using the new operator.wYH  0޽h ? ̙33E" 0 ( ? X  C 4   w  S 4dw4 @  w EConsider the case when you want to create a SAS data set from a query on a remote database. Moving query results into a SAS table requires two steps Step One build a statement that defines the columns and types; Step Two read the results into the columns. Since we are using javaobj, this task requires two data steps, and oops would require the one query be executed two times on the remote system. Not good. If the query results could be made to persist somewhere between the DATA Steps, then the query has to be issued only one time. This is the case for finding that somewhere.6F 6 iH  0޽h ? ̙33 0 x(  R  3 4   w~  C ow4 @  w  H  0޽h ? ̙33$ 0 ~@(  @X @ C 4   ~ @ S ^ 4 @   If you wanted to expand the gateway to have more functionality, you would list additional methods here and implement them in GatewayManager. You would also have to implement adapter versions in DataStepGatewayAdapter$|6H @ 0޽h ? ̙33J3 0  (  X  C 4   u  S 41u4 @  u If java class Z is in a package A.B.C, the class in the declare statement is  A/B/C/Z . Each entry specified in the CLASSPATH is searched for relative path A/B/C, first one found is instantiated.H  0޽h ? ̙334 0 RJ(  X  C 4   uJ  S /u4 @  u JDBC driver classes implement standard methods that to provide access to database. A Java class that works with databases does not have to be changed when connecting to a different database; only the connection parameters need to be changed (parameters can be often specified in a login dialog or configuration file, should not be hard-coded). A JDBC driver is implemented in or more Java classes and is most often deployed or distributed as one or more jar files.H  0޽h ? ̙33E9 0 0( @ X  C 4   w  S gw4 @  w EConsider the case when you want to create a SAS data set from a query on a remote database. Moving query results into a SAS table requires two steps Step One build a statement that defines the columns and types; Step Two read the results into the columns. Since we are using javaobj, this task requires two data steps, and oops would require the one query be executed two times on the remote system. Not good. If the query results could be made to persist somewhere between the DATA Steps, then the query has to be issued only one time. This is the case for finding that somewhere.6F 6 iH  0޽h ? ̙33E: 0 P(  X  C 4   w  S jw4 @  w EConsider the case when you want to create a SAS data set from a query on a remote database. Moving query results into a SAS table requires two steps Step One build a statement that defines the columns and types; Step Two read the results into the columns. Since we are using javaobj, this task requires two data steps, and oops would require the one query be executed two times on the remote system. Not good. If the query results could be made to persist somewhere between the DATA Steps, then the query has to be issued only one time. This is the case for finding that somewhere.6F 6 iH  0޽h ? ̙33E; 0 p(  X  C 4   w  S mw4 @  w EConsider the case when you want to create a SAS data set from a query on a remote database. Moving query results into a SAS table requires two steps Step One build a statement that defines the columns and types; Step Two read the results into the columns. Since we are using javaobj, this task requires two data steps, and oops would require the one query be executed two times on the remote system. Not good. If the query results could be made to persist somewhere between the DATA Steps, then the query has to be issued only one time. This is the case for finding that somewhere.6F 6 iH  0޽h ? ̙33< 0 (  X  C 4   w  S x4 @  w  H  0޽h ? ̙33r@#Hj r@n`lswbc{@yaUu& O*cӼҾ{=7puW-C9N pPZ UWq K>Yu}z!K0U <vOh+'00 hp    $,No Slide TitleRichard A. DeVeneziaPRichard A. DeVeneziaP57hMicrosoft PowerPointP@B4@0p&!@ ч`@l -GoM  u %& &&#TNPP0{| & TNPP &&TNPP    &&--&&@- $0Z $Z@- $>?- $>h}>- $h{=- $Lx<- $Lvv;- $vs9- $Z*p8- $*Zm6- $k5- $h8i4- $8hg3- $f3- $vF $Fv&&&- & $&&-&& &&-&&&&@- $0Z $Z@- $>?- $>h}>- $h{=- $Lx<- $Lvv;- $vs9- $Z*p8- $*Zm6- $k5- $h8i4- $8hg3- $f3- $vF $Fv&- --&&&&--&&f3- $nR $Rg3- $ei4- $eIk5- $I m6- $ [p8- $[@s9- $@v;- $Rx<- $R6{=- $6}>- $I?- $I-@- $-@- $@ $@$&&&- & $&&-&& &&-&&&&f3- $nR $Rg3- $ei4- $eIk5- $I m6- $ [p8- $[@s9- $@v;- $Rx<- $R6{=- $6}>- $I?- $I-@- $-@- $@ $@$&- --&&--yyH--}w@ wƬw0- Times New RomanwƬw0- .2 "5SAS/AF!*!*!-. . 2 ") . . 2 "7and. ."2 iInternet Explorer$:.--8-- Times New RomanwƬw0- .%2 Richard A. DeVenezia  #  .--"System 0-&TNPP &՜.+,D՜.+,<    On-screen Show -s`1 "Times New RomanArial Arial Black Courier NewDefault DesignSAS/AF and Internet ExplorerSAS/AF Web pagesWhy use a web pageInternet Explorer HTML FormsActiveX componentsMicrosoft Web Browser SAS/AF Frame MSBRWSEH.SCLERRORBeforeNavigate2 Now what?Adapter DesignOCX Development Simple FrameAFBROWSER.FRAMEAFBROWSER.FRAME AFBRWSEH.SCL AFBRWSEH.SCL AFBRWSEH.SCLGetWebInput.sclWeb Inputs to SAS TableCaptureInput.sclCaptureInput.sclCaptureInput.sclCaptureInput.scl ConclusionAbout the Author  Fonts UsedDesign Template Slide Titlesl(RZ _PID_GUID _PID_HLINKSAN{12448A5D-72F8-4A24-ABA6-3FDBA8ABCB78}A8http://www.devenezia.com/downloads/sas/actions/main.php'http://www.devenezia.com/downloads/sas'http://www.devenezia.com/downloads/sas,_Richard A. DeVenezia  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}Root EntrydO)Current UserSummaryInformation(~`PowerPoint Document(DocumentSummaryInformation8