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 Test2 in the Project Name field.


  5. Type C:\test\ftocxx\Test2 in the Location field.


  6. Click on OK.


  7. Click on Finish.


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


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


  10. Highlight test2 files and right click.


  11. Select Add New Files to Project.


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


  13. In the Workspace Window, open the Source Files folder and double click on ftoc.cxx. (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 /Fo"Release/" options 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/test2.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 should look something like this:


  26. Deleting intermediate files and output files for project 'Test2 - Win32 Release'.
    --------------------Configuration: Test2 - 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\cxx" 
    -Adigraph1 -Adigraph2 -DCROSS370=1 -XA -Hu '-mftoc' "C:\test\ftocxx\ftoc.cxx" 'C:\TEMP\sascc48.47.c'
    SAS/C C++ 7.00.01 (Aug 13 2000)
    Copyright (c) 2000 SAS Institute Inc.
    "C:\Program Files\SAS Institute\SASC701\host\wnt\bin\lc1" 
    -dCROSS370=1 -hu -n! -cxx '-sftoc' '-oC:\TEMP\sascc49.1.q' "C:\TEMP\sascc48.47.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" '-oftoc.obj' "C:\TEMP\sascc49.1.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
    
    Test2.out - 0 error(s), 0 warning(s)
    


  27. Open an Explorer window and view the files in C:\test\ftocxx\test2. These are the project files created by Developer Studio.


  28. Now view the files in C:\test\ftocxx\test2\Release. The ftoc.obj file is the output from the SAS/C compiler and the test2.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.