Resources

More about This Product

SAS/C

The SAS/C® Tour


Sample C Project

  1. Start Microsoft Developer Studio.


  2. Select Tools->Compiler Options, and then select SASC/C++ Cross-Platform Compiler and click on OK.


  3. Select File->New and then click on the Projects tab. Select Win32 Console Application.


  4. Type Test1 in the Project Name field.


  5. Type C:\test\ftoc\Test1 in the Location field.


  6. Click on OK.


  7. Click on Finish.


  8. Click on OK. (The Test1 project has now been created.)


  9. Click on the FileView tab of the test1 Workspace Window.


  10. Highlight test1 files and right click.


  11. Select Add New Files to Project.


  12. Browse the file system until you find C:\test\ftoc\ftoc.c and double click on it. (ftoc.c has now been added to your test1 source files.)


  13. In the Workspace Window, open the Source Files folder and double click on ftoc.c. (An editor window is opened with the source code for ftoc.c displayed.)


  14. Open the Build->Set Active Configuration dialog box.


  15. Highlight Win32 Release and click on OK. (You have now selected a release project instead of a debug project.)


  16. Open the Project->Settings dialog box.


  17. From the General tab, verify that the Intermediate Files and Output Files fields specify Release.


  18. Click on the C/C++ tab.


  19. Clear all the Microsoft compiler options form the Project Options box and add the -v (verbose) SAS/C compiler option. (Developer Studio will add the /ML option automatically.)


  20. Click on the Link tab.


  21. Clear all the Microsoft linker options from the Project Options box. (COOL options could be added here. Developer Studio will automatically add the project options that it requires.)


  22. In Output file name box, change the name to Release/test1.out. This will be the name and location of your prelinked output file.


  23. Click on OK.


  24. Select Build->Rebuild All. This compiles and prelinks the ftoc.c application.


  25. The output log from the build should look something like this:
    Deleting intermediate files and output files for project 'test1 - Win32 Release'.
    --------------------Configuration: test1 - Win32 Release--------------------
    Compiling...
    SAS/C Compiler Driver V7.00.01
    Copyright (C) 2000 SAS Institute Inc.
    set INCLUDE370='C:\Program Files\SAS Institute\SASC701\Include'
    "C:\Program Files\SAS Institute\SASC701\host\wnt\bin\lc1" 
    -dCROSS370=1 -hu -n! '-oC:\TEMP\sascc3.2.q' "C:\test\ftoc\ftoc.c"
    SAS/C Release 7.00.01 (Target 370 Cross Compiler)
    Copyright(c) 2000 by SAS Institute Inc.  All Rights Reserved.
    *** No errors; No warnings; No user suppressed warnings
    "C:\Program Files\SAS Institute\SASC701\host\wnt\bin\lc2"
     '-oRelease//ftoc.obj' "C:\TEMP\sascc3.2.q"
    SAS/C Compiler(Phase 2)Release 7.00.01
    Copyright(c) 2000 by SAS Institute Inc.  All Rights Reserved.
    You have selected the SAS C/C++ Cross Platform Compiler
    Linking...
    SAS/C Compiler Driver V7.00.01
    Copyright (C) 2000 SAS Institute Inc.
    You have selected the SAS C/C++ Cross Platform Linker
    
    test1.out - 0 error(s), 0 warning(s)
      


  26. Open an Explorer window and view the files in C:\test\ftoc\test1. These are the project files created by Developer Studio.


  27. Now view the files in C:\test\ftoc\test1\Release. The ftoc.obj file is the output from the SAS/C compiler and the test1.out file is the output from cool. You can ftp the test1.out file to MVS where you can use the linkage editor to create an executable load module.