Ampersand as character, not as prefix for variables
search cancel

Ampersand as character, not as prefix for variables

book

Article ID: 74725

calendar_today

Updated On:

Products

NetSpy Network Performance NetMaster Network Automation SOLVE NetMaster Network Management for SNA NetMaster Network Management for TCP/IP NetMaster File Transfer Management

Issue/Introduction

It happens that you want to use the Ampersand '&' as a character and not as a prefix for variable names.

 

For example you want to put a line like this into a variable:

//SYSLIN   DD  DSN=&&OBJECT,DISP=(OLD,DELETE)

Resolution

In order to get the string

//SYSLIN   DD  DSN=&&OBJECT,DISP=(OLD,DELETE)

into a variable you use these two lines of code:

&DSN = &CONCAT & & OBJECT                          
&Q = &STR //SYSLIN   DD  DSN=&DSN,DISP=(OLD,DELETE)

Variable &DSN is filled with the three character which are concatenated by &CONCAT: '&', '&' and 'OBJECT'. Thus, &DSN is filled with the string '&&OBJECT'