www.sas.com > Service and Support > Technical Support
 
Technical Support SAS - The power to know(tm)
  TS Home | Intro to Services | News and Info | Contact TS | Site Map | FAQ | Feedback


/*--------------------------------------------------------------------+
|                                                                     |
|                 Copyright (c) 1996, SAS Institute Inc.              |
|                   Unpublished - All Rights Reserved                 |
|                                                                     |
|                     S A S / C  S A M P L E                          |
|                                                                     |
|         Name: SPFLOAD                                               |
|                                                                     |
|     Language: C                                                     |
|                                                                     |
|   EntryPoint: MAIN                                                  |
|                                                                     |
|   Entry Type: Standard OS Entry Linkage                             |
|                                                                     |
|   Files Note: 'prefix' is the installation defined high level       |
|               qualifier for the SAS/C product.                      |
|                                                                     |
|     Function: Dynamically load the ISPF ISPLINK function using a    |
|               C version of the MVS LOAD macro (SVC 8) and then      |
|               call it.                                              |
|                                                                     |
|                                                                     |
|      Returns: The last return code from ISPLINK.                    |
|                                                                     |
|        Files:                                                       |
|               - prefix.SAMPLE.C:                                    |
|                 .SPFLOAD   - sample using MVS LOAD macro            |
|                 .SPFLOADM  - sample using SAS/C LOADM() function    |
|                              instead of the MVS LOAD macro          |
|                                                                     |
|               - prefix.SAMPLE.AUX(LOAD)                             |
|                 .SPFLOADH  - header file for SPFLOAD with C macro   |
|                              versions of the MVS LOAD and DELETE    |
|                              macros                                 |
|                 .SPFLOADJ  - JCL to compile/link the samples        |
|                                                                     |
|                                                                     |
| MVS -  Compile/Link: submit prefix.SAMPLE.AUX(SPFLOADJ)             |
|                                                                     |
| CMS -  Not Tested                                                   |
|                                                                     |
| Misc Notes:                                                         |
|             - SPFLOAD is a two part sample, this is part 1 which    |
|               uses the MVS LOAD macro, the second part uses the     |
|               SAS/C LOADM() function to accomplish the same         |
|               capability.                                           |
|                                                                     |
+--------------------------------------------------------------------*/

#include <stdio.h>
#include "spfloadh.h"             /* LOAD & DELETE C macros         */

void main()
{
   __asm int(*asmtest)();
   int lrc=0,
       rc=0,
       size=0;
                                  /* Dynamically load the asm func  */
   lrc = LOAD("ISPLINK ", &asmtest, &size);

                                  /* If loaded ok, run it           */
   if (!lrc)
      {
      printf("ISPLINK LOADED OK\n");
      }
   else
      {
      printf("ISPLINK DID NOT LOAD\n");
      exit(lrc);
      }

   rc = asmtest("CONTROL ","ERRORS  ", "RETURN  ");
   if (rc)
      printf("ISPLINK: CONTROL Failed.\n");
   else
      printf("ISPLINK: CONTROL succedded.\n");

   rc = asmtest("DISPLAY ","LSC##TT2", " ", " ");
   if (rc)
      printf("ISPLINK: DISPLAY Failed.\n");
   else
      printf("ISPLINK: DISPLAY succedded.\n");

   if (!lrc)                      /* If loaded ok, DELETE it.       */
      rc = DELETE("ISPLINK ");

   exit(rc);
}

Copyright (c) 2000 SAS Institute Inc. All Rights Reserved.
Terms of Use & Legal Information | Privacy Statement