PreviousNext

Processing the sams File

The entire sams file for the hello_svc program is as follows:

# Part I

component hel

table hel_msg_table


# Part II

serviceability table hel_svc_table handle hel_svc_handle

start

subcomponent hel_s_main "main" hel_i_svc_main

end


# Part III

start

code hel_s_hello

subcomponent hel_s_main

attributes "svc_c_sev_notice | svc_c_route_stderr"

text "Hello World"

explanation "?"

action "None required."

end


# Part IIIa

start !intable undocumented

code hel_i_svc_main

text "hello_svc main"

end

We create the file with these contents and name it hel.sams. It can be processed with the simple command that follows:

sams hel.sams

Running the command as shown will result in ten files being created:

dcehel.cat
XPG4 message catalog file created by gencat. If you wish to use the message catalog, you must install it yourself. Its proper location is platform dependent.

dcehel.msg
Message input file for gencat.

dcehelmac.h
Defines convenience macros for use with the serviceability interface to write serviceability messages.

dcehelmsg.c
Code defining the in-memory table of message texts. By using this table, you can avoid depending on extracting message texts from the message catalog.

dcehelmsg.h
Header file containing definitions for dcehelmsg.c.

dcehelmsg.sml
Code for a OSF DCE Problem Determination Guide subsection documenting the messages.

dcehelmsg.man
Code for a reference page subsection documenting the messages.

dcehelmsg.idx
Code for building an index for the OSF DCE Problem Determination Guide subsection.

dcehelsvc.c
Code defining the serviceability table. (This is a separate table containing the serviceability subcomponent identifying messages specified at the end of the sams file.)

dcehelsvc.h
Header file containing definitions for dcehelsvc.c.

Of these files, only the following are needed for the hello_svc program:

dcehelmac.h
Contains convenience macro code.

dcehelmsg.c
Contains in-memory message table code.

dcehelmsg.h
Contains definitions for in-memory message table code.

dcehelsvc.c
Contains serviceability message table code.

dcehelsvc.h
Contains definitions for serviceability message table code.

The three header files should be included into the program source code. The dcehelmsg.c and dcehelsvc.c modules should be compiled and linked with the program object module.

All that remains now is to create a simple C program that calls the necessary serviceability routines to output the "Hello World" message.