//A2CMCJ   JOB ............................................. <== Verify
//*
//*********************************************************************
//**                                                                  *
//**           Copyright (c) 1995 - SAS Institute, Inc.               *
//**             Unpublished - All Rights Reserved                    *
//**                                                                  *
//**  Name   : A2CMCJ                                                 *
//**                                                                  *
//**  Purpose: Demonstrate a SAS/C ALLRESIDENT main being called via  *
//**           entry point $MAINC.  The C main is loaded via OS       *
//**           load.  Being allresident, the C main does NOT require  *
//**           the SAS/C Transient Library at runtime.                *
//**                                                                  *
//**  Function: Compile, assemble, and lked'it source files listed    *
//**            below.                                                *
//**                                                                  *
//**  Source  : See prefix.SAMPLE.ASM members -                       *
//**            A2CMC     - C Main                                    *
//**            A2CMCASM  - Assembler                                 *
//**            A2CMCEMG  - C function to display messages for        *
//**                        A2CMCASM                                  *
//**                                                                  *
//**  Details : See prefix.SAMPLE.ASM(A2CMCASM)                       *
//**                                                                  *
//**  NOTE: Ensure the statments indicated by '<==Verify' have been   *
//**        customized for your local environment.  'prefix' is the   *
//**        installation defined high level qualifier for the         *
//**        SAS/C product.                                            *
//**                                                                  *
//*********************************************************************
//*
//*********************************************************************
//*                                                                   *
//*  Compile the C function that will be called from assembler to     *
//*  display messages.  INDEP is required so that upon execution a    *
//*  C framework will be established.                                 *
//*                                                                   *
//*********************************************************************
//*
//CC           EXEC LC370C,PARM.C='INDEP'
//C.SYSLIN     DD DSN=your.object.library(A2CMCEMG),         <== Verify
//             DISP=OLD
//C.SYSIN      DD DSN=prefix.SAMPLE.ASM(A2CMCEMG),           <== Verify
//             DISP=SHR
//*
//*
//*********************************************************************
//*                                                                   *
//*  Assemble the assembler program that will be calling the C Main   *
//*  program.  By default assembler generates AMODE(24)/RMODE(24)     *
//*  objects and SAS/C generates AMODE(31)/RMODE(ANY) objects.  In    *
//*  this example, the assembler must be prepared to handle a         *
//*  31 bit address retunred from OS LOAD for the C main.  The        *
//*  assembler will be LKED'ed with AMODE(31)/RMODE(ANY) to handle    *
//*  this situation.                                                  *
//*                                                                   *
//*  Options NODECK and OBJECT are to control how the assembler will  *
//*  handle the output object deck.                                   *
//*                                                                   *
//*  The SYSLIB DD is needed to resolove external references from     *
//*  C function A2CMCEMG.                                             *
//*                                                                   *
//*********************************************************************
//*
//A2CMCASM     EXEC hlasmcl,COND=(0,NE),                     <== Verify
//             PARM.ASM='NODECK,OBJECT',
//             PARM.LKED='MAP,LET,LIST'
//ASM.SYSLIN   DD DSN=your.object.library(A2CMCASM),         <== Verify
//             DISP=OLD
//ASM.SYSIN    DD DSN=prefix.SAMPLE.ASM(A2CMCASM),           <== Verify
//             DISP=SHR
//LKED.SYSLMOD DD DSN=your.load.library(A2CMCASM),           <== Verify
//             DISP=OLD
//LKED.SYSLIB  DD DSN=prefix.STDLIB,                         <== Verify
//             DISP=SHR
//             DD DSN=prefix.BASELIB,                        <== Verify
//             DISP=SHR
//LKED.SYSLIN  DD DSN=your.object.library(A2CMCASM),         <== Verify
//             DISP=SHR
//LKED.OBJINPT DD DSN=your.object.library,                   <== Verify
//             DISP=SHR
//LKED.SYSIN   DD *
  INCLUDE  OBJINPT(A2CMCEMG)     C function to print messages
  INCLUDE  OBJINPT(A2CMCASM)     Assembler program
  MODE     RMODE(ANY),AMODE(31)  Make it Compatible with C Main
  ENTRY ASMAIN                   Ensure Correct Entry Point
  NAME  A2CMCASM(R)              PDS Member Name
/*
//*
//*********************************************************************
//*                                                                   *
//*  Compile the C Main program that will be called by entry point    *
//*  $MAINC.                                                          *
//*                                                                   *
//*         Note: DOLLARS option is required for ALLRES.              *
//*                                                                   *
//*********************************************************************
//*
//A2CMC        EXEC LC370C,COND=(0,NE),
//             PARM.C='SNAME(A2CMC) DOLLARS'
//C.SYSIN      DD DSN=prefix.SAMPLE.ASM(A2CMC),              <== Verify
//             DISP=SHR
//C.SYSLIN     DD DSN=your.object.library(A2CMC),            <== Verify
//             DISP=SHR
//*
//*********************************************************************
//*                                                                   *
//*  Link the C Main as an ALL RESIDENT application, CLINK/COOL is    *
//*  required for ALLRES.                                             *
//*                                                                   *
//*  NOTE: SAS/C by default produces AMODE(31)/RMODE(ANY) objects.    *
//*                                                                   *
//*********************************************************************
//A2CMCL       EXEC LC370LR,COND=(0,NE),ALLRES=YES
//LKED.SYSLMOD DD DSN=your.load.library,                     <== Verify
//             DISP=OLD
//LKED.OBJINPT DD DSN=your.object.library,                   <== Verify
//             DISP=SHR
//LKED.SYSIN   DD *
  INCLUDE OBJINPT(A2CMC)         C Main
  ENTRY $MAINC                   Entry Point for Arguments ONLY
  NAME  A2CMC(R)                 PDS Member Name
/*
//*
//*********************************************************************
//*                                                                   *
//* Execute the sample.                                               *
//*                                                                   *
//* Note:                                                             *
//*      -The SAS/C Transient Library is NOT specified in the STEPLIB *
//*       search order                                                *
//*                                                                   *
//*      -Output for stdout has been redirected to SYSOUTC via        *
//*       SAS/C source                                                *
//*                                                                   *
//*********************************************************************
//*
//GO           EXEC PGM=A2CMCASM,COND=(0,NE)
//STEPLIB      DD DSN=your.load.library,                      <==Verify
//             DISP=SHR
//SYSOUTC      DD SYSOUT=A           <== stdout for entry point $MAINC
//SYSTERM      DD SYSOUT=A           <== stderr
/*
//