要创建通道,应使用 Task 类的 createChannel() 方法。
Task t=Task.getTask();
Channel custData = t.createChannel("Customer_Data");
提供给 createChannel 方法的字符串是 CICS 能够理解的 Channel 对象的名称。(名称使用空格填充到 16 个字符以符合 CICS 命名约定。)Container custRec = custData.createContainer("Customer_Record");
提供给 createContainer() 方法的字符串是 CICS 能够理解的 Container 对象的名称。(如果需要,名称使用空格填充到 16 个字符以符合 CICS 命名约定。)如果该通道已有同名的容器,那么将抛出 ContainerErrorException。