数据集名称 JCL 中的符号参数
在 JCL 中,通常使用 & 创建符号参数。 (与符号)后跟变量名称。
但在数据集名称中,变量名称后面必须跟有点号。 例:
//J&USER JOB 1
//MYSTEP EXEC PGM=MYPROG
//MYDATA DD DSN=&USER..MYCLASS.COOL
为什么会这样呢?我怕以后不一致,所以才问这个问题。提前感谢您的任何帮助。
In JCL, normally Symbolic parameters is created using & (Ampersand sign) followed by the variable name.
But in dataset name, It has to followed by the dot sign after the variable name.
Example:
//J&USER JOB 1
//MYSTEP EXEC PGM=MYPROG
//MYDATA DD DSN=&USER..MYCLASS.COOL
Why is that so? I am afraid of inconsistency later, so I ask this question. Thanks for any helps in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如符号参数的开头由与号 (&) 标记一样。它可能会被终止
一个空格或一个句点。当以句点终止时,句点不是名称的一部分(就像开头部分一样)
& 符号不是)。
当整个字符串被符号参数替换时,它只是按原样编码:
这里
&MYPROG
被替换为它的值,FRED
。弄清楚符号名称的开始或结束位置没有问题。现在假设您要运行 3 个程序:
FRED1
、FRED2
和FRED3
。您可以执行以下操作:这里,程序
FRED3
正在运行。符号MYPROG
以句点结尾,相当于FRED
,对此添加其余文本,生成
FRED3
。在数据集名称中使用符号参数时,同样的情况也适用。需要第一个周期来终止
符号名称,下一个句点是数据集名称本身的一部分。例如,如果符号
USER
的计算结果为ABC123
,然后计算结果为
ABC123.MYDATA
作为数据集名称。同样,计算结果为:
ABC123X.MYDATA
请注意,生成的 DSN 有一个句点,因为第一个句点终止符号名称并且不是结果的一部分。
Just as the beginning of a symbolic parameter is marked by an ampersand (&). It may be terminated by
a space or a period. When terminated by a period, the period is not part of the name (just as the opening
ampersand isn't).
When an entire string is replaced by a symbolic parameter it is just coded as is:
Here
&MYPROG
is replaced with its value,FRED
. No problem figuring out where the symbolic name started or ended.Now suppose you wanted to run 3 programs:
FRED1
,FRED2
andFRED3
. You could do something like:Here, program
FRED3
is being run. The symbolMYPROG
terminated by a period and equates toFRED
, to this therest of the text is added yielding
FRED3
.Same thing applies when using symbolic parameters within dataset names. The first period is needed to terminate
the symbol name, the next period is part of the dataset name itself. For example, if symbol
USER
evaluates toABC123
, thenevaluates to
ABC123.MYDATA
as a data set name. Similarly,evaluates to:
ABC123X.MYDATA
Note that the resulting DSN has a single period, because the first oneterminated the symbolic name and is not part of the result.
简单来说,如果一个符号参数后面有一个句点(.),则需要额外添加一个句点(.),从而产生2个句点(.)。
根据您的情况,您必须使用两个句点 (.) 是正确的。
此讨论说第一个句点用于连接,而其他人则说它是符号变量的终止。但这并不重要。第二个句点成为数据集名称的一部分。
示例:
如果 &USER 解析为 USR01,那么它将被解释为
仅在数据集中使用第二个句点。
但是,想象一下,如果你有这样的东西,会发生什么
数据集将类似于 USR01MYCLASS.COOL。这是一个错误,因为每个级别不应超过 8 个字符。
In simple terms, if a symbolic parameter is followed by a period (.), then an additional period (.) needs to be added, thus resulting in 2 periods (.).
Based on your scenario, it is correct that you must use two periods (.).
This discussion said that the first period is used for concatenation, while some others said that it's part of the termination of the symbolic variable. But it doesn't really matter. The second period becomes part of the dataset name.
Example:
If &USER resolved as USR01, then it will be interpreted as
Only the second period will be used in your dataset.
But, imagine if you have something like this, what will happen
The dataset will be something like USR01MYCLASS.COOL. This is an error, as each level shouldn't have more than 8 characters.