能否请您帮助我实现低于目标的JCL排序? 我有不同的if记录输入文件。我需要删除基于10,04位置的仅特定记录类型的重复项。其他类型的记录不应有任何更改。
我需要删除位置10,4上P4的重复项。
iNPUT:
P1AAAAAAA0101xxxxxxx
P2AAAAAAA0101xxxxxxx
P4AAAAAAA0101xxxxxxx
P4AAAAAAA0101xxxxxxx
P4AAAAAAA0102xxxxxxx
P4AAAAAAA0103xxxxxxx
P4AAAAAAA0104xxxxxxx
P5AAAAAAA0101xxxxxxx
P7AAAAAAA0101xxxxxxx
P9AAAAAAA0101xxxxxxx
预期输出:
P1AAAAAAA0101xxxxxxx
P2AAAAAAA0101xxxxxxx
P4AAAAAAA0101xxxxxxx
P4AAAAAAA0102xxxxxxx
P4AAAAAAA0103xxxxxxx
P4AAAAAAA0104xxxxxxx
P5AAAAAAA0101xxxxxxx
P7AAAAAAA0101xxxxxxx
P9AAAAAAA0101xxxxxxx
答案 0 :(得分:0)
我想为您介绍一个小的解决方案,有点复杂,但是可以用,也许有人会比我的紧凑一些:
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
P1AAAAAAA0101xxxxxxx
P2AAAAAAA0101xxxxxxx
P4AAAAAAA0101xxxxxxx
P4AAAAAAA0101xxxxxxx
P4AAAAAAA0102xxxxxxx
P4AAAAAAA0103xxxxxxx
P4AAAAAAA0104xxxxxxx
P5AAAAAAA0101xxxxxxx
P7AAAAAAA0101xxxxxxx
P7AAAAAAA0101xxxxxxx
P9AAAAAAA0101xxxxxxx
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T2 DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//T3 DD DSN=&&T3,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN) TO(T1) USING(AST1)
COPY FROM(IN) TO(T2) USING(AST2)
SELECT FROM(T1) TO(T3) ON(10,4,CH) NODUPS
MERGE FROM(T2,T3) TO(OUT) USING(AST3)
//AST1CNTL DD *
INCLUDE COND=(1,2,CH,EQ,C'P4')
//AST2CNTL DD *
INCLUDE COND=(1,2,CH,NE,C'P4')
//AST3CNTL DD *
MERGE FIELDS=(1,14,CH,A)
关于, 安德烈亚斯
答案 1 :(得分:0)
你在这里。
//JOBNAME JOB 1,NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SORTIN DD *
P1AAAAAAA0101XXXXXXX
P2AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0102XXXXXXX
P4AAAAAAA0103XXXXXXX
P4AAAAAAA0104XXXXXXX
P5AAAAAAA0101XXXXXXX
P7AAAAAAA0101XXXXXXX
P9AAAAAAA0101XXXXXXX
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1:1,20,21:SEQNUM,2,ZD)),
IFTHEN=(WHEN=(1,2,CH,EQ,C'P4'),OVERLAY=(21:C'01'))
SORT FIELDS=(1,2,CH,A,10,4,CH,A,21,2,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1:1,20)
INREC IFTHEN
来设置序列号的末尾
记录。对于前2个字节的记录,序列号设置为1
为P4
。SORT FIELDS
语句中包含的SUM FIELDS=NONE
只会删除那些记录。输出:
P1AAAAAAA0101XXXXXXX
P1AAAAAAA0101XXXXXXX
P2AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0102XXXXXXX
P4AAAAAAA0103XXXXXXX
P4AAAAAAA0104XXXXXXX
P5AAAAAAA0101XXXXXXX
P7AAAAAAA0101XXXXXXX
P9AAAAAAA0101XXXXXXX
让我们使用以下输入来运行相同的SORT语句集。请注意,前2个记录(P1)与P4重复。
//JOBNAME JOB 1,NOTIFY=&SYSUID
//STEP1 EXEC PGM=SORT
//SORTIN DD *
P1AAAAAAA0101XXXXXXX
P1AAAAAAA0101XXXXXXX
P2AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0102XXXXXXX
P4AAAAAAA0103XXXXXXX
P4AAAAAAA0104XXXXXXX
P5AAAAAAA0101XXXXXXX
P7AAAAAAA0101XXXXXXX
P9AAAAAAA0101XXXXXXX
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(1:1,20,21:SEQNUM,2,ZD)),
IFTHEN=(WHEN=(1,2,CH,EQ,C'P4'),OVERLAY=(21:C'01'))
SORT FIELDS=(1,2,CH,A,10,4,CH,A,21,2,CH,A)
SUM FIELDS=NONE
OUTREC FIELDS=(1:1,20)
运行作业后的输出如下所示。请注意,将保留重复的P1记录,并且仅删除具有特定记录类型(P4)的重复记录。
P1AAAAAAA0101XXXXXXX
P1AAAAAAA0101XXXXXXX
P2AAAAAAA0101XXXXXXX
P4AAAAAAA0101XXXXXXX
P4AAAAAAA0102XXXXXXX
P4AAAAAAA0103XXXXXXX
P4AAAAAAA0104XXXXXXX
P5AAAAAAA0101XXXXXXX
P7AAAAAAA0101XXXXXXX
P9AAAAAAA0101XXXXXXX
希望这会有所帮助。