0

我正在学习大型机编程(TSO、JCL、COBOL...),但遇到了一个似乎还无法解决的问题。

我有一个包含 3 个字段的记录的文件,我想使用“outfil”在输出文件中仅包含某些记录。

我的 JCL 如下:

000001 //C8112J1  JOB (12345678),C8112,MSGCLASS=H, 
000002 //            MSGLEVEL=(1,1),NOTIFY=C8112 
(...)   
000007 //DSNDEL   EXEC PGM=IDCAMS 
000008 //SYSPRINT DD SYSOUT=* 
000009 //SYSIN    DD * 
000010   DELETE   C8112.DATA.FX.SORT 
000011   SET      MAXCC = 0 
000012 /* 
(...)
000014 //*                  --------- S O R T ----------- 
000020 //MYSORT  EXEC PGM=SORT,COND=(0,NE) 
000021 //SORTIN  DD DSN=C8112.DATA.FX,DISP=SHR 
000022 //SORTOUT DD DSN=C8112.DATA.FX.SORT, 
000023 //           SPACE=(TRK,(100,100),RLSE), 
000024 //           DISP=(NEW,CATLG,DELETE), 
000025 //           DCB=(LRECL=61,RECFM=FB) 
000026 //SYSIN   DD * 
000027   SORT    FIELDS=COPY 
000028 //* SORT  FIELDS=(1,18,CH,A) OU SORT=COPY 
000029   OUTFIL  INCLUDE=(1,18,CH,EQ,C'ANDRADE,LUISA') 
...
000031 //*       OUTREC=(39,41,1,18,19,38) 
000032   END 
000033 //SYSOUT  DD SYSOUT=* 
000034 /* 

和输出文件:

000001 LUIS,CARLOS       AV.PAULO VI         RMR     
000002 DIAS,PATTY        RUA PEDRO CALMON    LX 
000003 ANDRADE,LUISA     AV. DA LIBERDADE    LX     (1)
000004 SILVA,TONI        PALACIO VALMOR      LX 
000005 ANDRADE,LUISA     AV. DA BOAVISTA     POT    (2) 
000006 CISCO,MANUEL      QUINTA DA AVELEDA   TC 

我不应该只得到记录(1)和(2)吗?!顺便说一句,我还尝试了“outrec”来更改字节组织,但它也没有奏效。谁能给我一个提示我做错了什么?

4

2 回答 2

3

You can use a single * as a comment delimiter in DFSORT rather than //* - which, as has already been pointed out terminates the SYSIN just as if you'd coded /. (You indeed have a / later on, I notice.)

于 2012-12-18T08:11:43.397 回答
2

尝试以下操作:

  000020 //MYSORT  EXEC PGM=SORT,COND=(0,NE) 
  000021 //SORTIN  DD DSN=C8112.DATA.FX,DISP=SHR 
  000022 //SORTOUT DD DSN=C8112.DATA.FX.SORT, 
  000023 //           SPACE=(TRK,(100,100),RLSE), 
  000024 //           DISP=(NEW,CATLG,DELETE), 
  000025 //           DCB=(LRECL=61,RECFM=FB) 
  000026 //SYSIN   DD * 
  000027   SORT    FIELDS=COPY 
  000029   OUTFIL  INCLUDE=(1,18,CH,EQ,C'ANDRADE,LUISA') 
  ...
  000032   END 
  000031 /*
  000033 //SYSOUT  DD SYSOUT=* 
  000034 //* 

SORT SYSIN 不允许“评论”。您认为可能是评论的那些行实际上不是。它们终止 SYSIN DD 语句。基本上我刚刚摆脱了:

//* SORT  FIELDS=(1,18,CH,A) OU SORT=COPY

//*       OUTREC=(39,41,1,18,19,38)

then it all works fine. Remember, a JCL comment is not a SORT comment! The stuff after a DD * are data, not JCL source statements so JCL type commenting conventions do not work here. The DD * is typically terminated by a line starting with: /*.

于 2012-12-17T16:53:06.980 回答