HLASM Language Reference

HLASM Language Reference HLASM Language Reference

faculty.cs.niu.edu
from faculty.cs.niu.edu More from this publisher
22.02.2015 Views

System Variable Symbols System Variable Symbols System variable symbols are a special class of variable symbols, starting with the characters &SYS. Their values are set by the assembler according to specific rules. You cannot declare them in local-scope SET symbols or global-scope SET symbols, nor use them as symbolic parameters in macro prototype statements. You can use these symbols as points of substitution in model statements and conditional assembly instructions. All system variable symbols are subject to the same rules of concatenation and substitution as other variable symbols. A description of each system variable symbols begins on page 263. You should not prefix your SET symbols with the character sequence &SYS. The assembler uses this sequence as a prefix to all system variable symbol names, and using them for other SET symbol names might cause future conflicts. Scope and Variability of System Variable Symbols Global Scope: Some system variable symbols have values that are established at the beginning of an assembly and are available both in open code and from within macros. These symbols have global scope. Most system variable symbols with global scope have fixed values, although there are some whose value can change within a single macro expansion. The global-scope system variables symbols with variable values are &SYSSTMT, &SYSM_HSEV, and &SYSM_SEV. Local Scope: Some system variable symbols have values that are available only from within a macro expansion. These system variables have local scope. Since the value of system variable symbols with local scope is established at the beginning of a macro expansion and remains unchanged throughout the expansion, they are designated as having constant values, even though they might have different values in a later expansion of the same macro, or within inner macros. Over half of the system variable symbols have local scope and therefore are not available in open code. 262 HLASM V1R5 Language Reference

&SYSADATA_DSN System Variable Symbol | 1 macro | 2 getlocalsys | 3 . Define globals for values of interest | 4 Gblc &clock,&location,&dsname,&nest | 5 Gbla &nesta | 6 . now update the globals from within the macro | 7 &clock setc '&sysclock' | 8 &location setc '&sysloc' | 9 &dsname setc '&sysin_dsn' | 1 &nest setc '&sysnest' | 11 &nesta seta &sysnest | 12 mend | 2 14 r csect | 15 | 16 define globals in opencode | 17 | 18 Gblc &clock,&location,&dsname,&nest | 19 Gbla &nesta | 2 | 21 invoke macro to update the global values | 22 | 23 getlocalsys | 24 | 25 now use the updated values | 26 | 27 dc c'&clock' | F2FFF46FF66 + dc c'24-6-11 17:48:42.914829' | 28 dc c'&nest' | 1A F1 + dc c'1' | 29 dc f'&nesta' | 1B | 1C 1 + dc f'1' | 31 end r Figure 65. Exposing the Value of a Local Scope Variable to Open Code Uses, Values and Properties: System variable symbols have many uses, including: Helping to control conditional assemblies Capturing environmental data for inclusion in the generated object code Providing program debugging data Refer to Appendix C, “Macro and Conditional Assembly Language Summary” on page 409 for a summary of the values and properties that can be assigned to system variable symbols. &SYSADATA_DSN System Variable Symbol Use &SYSADATA_DSN in a macro definition to obtain the name of the data set to which the assembler is writing the associated data. The local-scope system variable symbol &SYSADATA_DSN is assigned a read-only value each time a macro definition is called. When the assembler runs on the MVS operating systems, the value of the character string assigned to &SYSADATA_DSN is always the value stored in the JFCB for SYSADATA. If SYSADATA is allocated to DUMMY, or a NULLFILE, the value in &SYSADATA_DSN is NULLFILE. For example, &SYSADATA_DSN might be assigned a value such as: IBMAPC.SYSADATA Chapter 7. How to Specify Macro Definitions 263

&SYSADATA_DSN System Variable Symbol<br />

| 1 macro<br />

| 2 getlocalsys<br />

| 3 . Define globals for values of interest<br />

| 4 Gblc &clock,&location,&dsname,&nest<br />

| 5 Gbla &nesta<br />

| 6 . now update the globals from within the macro<br />

| 7 &clock setc '&sysclock'<br />

| 8 &location setc '&sysloc'<br />

| 9 &dsname setc '&sysin_dsn'<br />

| 1 &nest setc '&sysnest'<br />

| 11 &nesta seta &sysnest<br />

| 12 mend<br />

| 2 14 r csect<br />

| 15 <br />

| 16 define globals in opencode<br />

| 17 <br />

| 18 Gblc &clock,&location,&dsname,&nest<br />

| 19 Gbla &nesta<br />

| 2 <br />

| 21 invoke macro to update the global values<br />

| 22 <br />

| 23 getlocalsys<br />

| 24 <br />

| 25 now use the updated values<br />

| 26 <br />

| 27 dc c'&clock'<br />

| F2FFF46FF66 + dc c'24-6-11 17:48:42.914829'<br />

| 28 dc c'&nest'<br />

| 1A F1 + dc c'1'<br />

| 29 dc f'&nesta'<br />

| 1B <br />

| 1C 1 + dc f'1'<br />

| 31 end r<br />

Figure 65. Exposing the Value of a Local Scope Variable to Open Code<br />

Uses, Values and Properties: System variable symbols have many uses,<br />

including:<br />

Helping to control conditional assemblies<br />

Capturing environmental data for inclusion in the generated object code<br />

Providing program debugging data<br />

Refer to Appendix C, “Macro and Conditional Assembly <strong>Language</strong> Summary” on<br />

page 409 for a summary of the values and properties that can be assigned to<br />

system variable symbols.<br />

&SYSADATA_DSN System Variable Symbol<br />

Use &SYSADATA_DSN in a macro definition to obtain the name of the data set to<br />

which the assembler is writing the associated data.<br />

The local-scope system variable symbol &SYSADATA_DSN is assigned a<br />

read-only value each time a macro definition is called.<br />

When the assembler runs on the MVS operating systems, the value of<br />

the character string assigned to &SYSADATA_DSN is always the value stored in<br />

the JFCB for SYSADATA. If SYSADATA is allocated to DUMMY, or a NULLFILE,<br />

the value in &SYSADATA_DSN is NULLFILE.<br />

For example, &SYSADATA_DSN might be assigned a value such as:<br />

IBMAPC.SYSADATA<br />

Chapter 7. How to Specify Macro Definitions 263

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!