如何在由作业liblist控制的两个不同的库之一中创建DTAQ? [英] How can I create a DTAQ in one of two different libs, controlled by the jobs liblist?

查看:97
本文介绍了如何在由作业liblist控制的两个不同的库之一中创建DTAQ?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在as/400上,我们有一个测试环境和一个生产环境.一旦我们测试了程序的正常运行,就可以将它们置于生产环境中.两种环境都包含一组相似的库.

On our as/400 we have a test environment and a productive environment. Once we tested our programs are working, we can put them in the productive environment. Both environments contain a similiar set of libraries.

告诉我们的程序的基本机制是,它们在运行的环境中使用的liblist.它们在某些方面有效,但在其他方面则无效.因此,我们通常在提交作业时将参数传递给程序,该参数告诉程序在测试环境或生产环境中工作.这让我很烦恼,因为我的程序在整个执行过程中始终必须携带此参数,甚至经常将其传递给其他程序.有时,初始程序甚至不需要信息本身,但仍必须将其用作参数,因为它会调用需要信息的程序.

The basic mechanism to tell our programs, in which environment they work, are liblists used for the jobs they run in. That works great, for some things, but for others it doesn't. Therefore we often have a parameter passed to the programs on job submission, that tells the program to work in either test or productive environment. That annoys the hell out of me, since my programs always have to carry this parameter throughout their whole execution time, and often even pass it on to other programs. Sometimes the initial program does not even need the information itself, but still has to take it as a parameter, because it calls a program that does need it.

要介绍我面临的具体问题: 较大过程中各个部分之间的通信通常是通过整个系统中的数据队列来完成的.根据liblist读取特定的DTAQ就像一个咒语,只需在DTAQ的名称上调用RCVDTAQ,liblist就会选择正确的lib.写入DTAQ也是一样.

To present the specific problem I am faced with: Communication between individual parts of a bigger process is often done via dataqueues throughout our sytem. Reading a specific DTAQ according to the liblist works like a charm, simply call RCVDTAQ on the DTAQ's name, the liblist takes care of choosing the right lib. Same goes for writing into DTAQs.

但是有时程序必须在侦听或写入新的DTAQ之前创建一个新的DTAQ.现在,这不适用于我们的布局和liblist.这样想吧:

But sometimes the program has to create a new DTAQ before listening or writing to it. Now that does not work with our layout and the liblists. Think of it like this:

PROD-liblist:

PROD-liblist:

PPGMLIB1
PPGMLIB2
PDFILELIB1
PDTAQLIB1
P...
...

TEST-liblist

TEST-liblist

TPGMLIB1
TPGMLIB2
TDFILELIB1
TDTAQLIB1
T...
...

现在我的程序应该在?DTAQLIB1中创建DTAQ,其中?应该是PT.

Now my program should create the DTAQ in ?DTAQLIB1, where ? should be either P or T.

我的第一个想法是遍历liblist并查找条目PDTAQLIBTDTAQLIB,并取其先来者-但是我无法弄清楚该怎么做(因此,我所关联的问题:如何可以从ILE程序(最好是RPG或CL)中读取liblist?

My first idea would be to go through the liblist and look for the entries PDTAQLIB or TDTAQLIB, and take whichever comes first -- but than I couldn't figure out how to to that (hence my connected question: How can I read the liblist from within an ILE-Program? (preferably RPG or CL)).

我知道我可以通过检查哪个用户拥有当前工作来实现我的目标,但这会破坏我们按liblists选择libs的逻辑(就像我们当前的解决方法一样).

I know I could possibly achieve my goal by checking, which user owns the current job, but that would break our logic of selecting the libs by liblists (like our current workaround does).

有什么我想念的吗?我正在尝试写一些特殊的方法来调用CRTDTAQ,还是一些特殊的api来进行此liblist比较?

Is there anything I'm missing? Some special way to to call CRTDTAQ maybe, or some special api to do this liblist comparison, that I'm trying to write?

推荐答案

Warren的配置文件构想是一个不错的主意,但听起来可能远远超出您的需要.仅仅使用数据区怎么样?

Warren's configuration file idea is a good one, but sounds like it would be a lot more than you need. How about just using a data area?

例如,确保您的?DFILELIB1库中始终存在一个名为MODE的数据区.该模式只能有一个字符"P"或"T".

For example, ensure there is always a data area called MODE in your ?DFILELIB1 library. It would have just a single character, "P" or "T", for the mode.

或更简单(尽管可能不太清楚):您可以测试是否存在TESTMODE数据区域,然后进行相应操作.

Or even simpler (though perhaps less clear): you could test for the presence or absence of a TESTMODE data area, and proceed accordingly.

这篇关于如何在由作业liblist控制的两个不同的库之一中创建DTAQ?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆