View previous topic :: View next topic
|
Author |
Message |
kris_madras
New User

Joined: 04 Jul 2005 Posts: 40
|
|
|
|
I have a data in the input files like this.
first format
Code: |
=COLS> ----+----1----+----2----+----3----+----4-
****** *****************************************
000001 IBMMAINFRAME.COM|SYNCSORT|DFSORT|ABCCO
****** ***************************************** |
Second format
Code: |
=COLS> ----+----1----+----2----+----3----+----4-
****** *****************************************
000001 IBMMAINFRAME.COM|SYNCSORT|DFSORT|XYZCO
****** ***************************************** |
third format
I know NOTMTOFL=RC8 works only if the output file (SORTOF01) has some data.
Similarly NULLOFL=RC8 works only if the output file (SORTOF01) has no data.
I tried to set RC=8 if my input data contains value 'ABCCO' or 'Empty' but observed that both options NULLOFL or NOTMTOFL doesn't work for all the input scenarios.
(1) NOTMTOFL- sets RC8 for first input but not working for EMPTY .
Code: |
INCLUDE COND=(34,5,CH,EQ,C'ABCCO'),NOTMTOFL=RC8 |
(2) NULLOFL - Sets RC8 for second input & empty file.
Code: |
INCLUDE COND=(34,5,CH,EQ,C'ABCCO'),NULLOFL=RC8 |
Please suggest the solution |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2194 Location: USA
|
|
|
|
kris_madras wrote: |
I know NOTMTOFL=RC8 works only if the output file (SORTOF01) has some data.
Similarly NULLOFL=RC8 works only if the output file (SORTOF01) has no data.
I tried to set RC=8 if my input data contains value 'ABCCO' or 'Empty' but observed that both options NULLOFL or NOTMTOFL doesn't work for all the input scenarios.
(1) NOTMTOFL- sets RC8 for first input but not working for EMPTY .
Code: |
INCLUDE COND=(34,5,CH,EQ,C'ABCCO'),NOTMTOFL=RC8 |
(2) NULLOFL - Sets RC8 for second input & empty file.
Code: |
INCLUDE COND=(34,5,CH,EQ,C'ABCCO'),NULLOFL=RC8 |
Please suggest the solution |
Everywhere: both NOTMTOFL, and NULLOFL perform checking the number of records IN OUTPUT files, NOT IN INPUT files.
From your samples it is not clear: what goes or not into your output??
P.S.
Those two parameters were allowed either for PARM field, or for OUTFIL statement. Never heard about using them in INCLUDE statement... |
|
Back to top |
|
 |
kris_madras
New User

Joined: 04 Jul 2005 Posts: 40
|
|
|
|
Yes.. They're parameters for OUTFIL statement. OUTFIL FILES=01 and then followed by include statement mentioned. |
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2194 Location: USA
|
|
|
|
kris_madras wrote: |
Yes.. They're parameters for OUTFIL statement. OUTFIL FILES=01 and then followed by include statement mentioned. |
The statements are processed by SORT in mandatory sequence; it does not depend on the order they appear in the //SYSIN input:
1) INCLUDE/OMIT
2) INREC
3) SORT
4) OUTREC
5) OUTFIL
One needs to keep this in mind. Changing the order of statements in //SYSIN doesn't affect the SORT behavior, but adds a lot of mess to the minds of people who try to understand it.
INCLUDE COND= is a separate statement, processed BEFORE any other statement. Even when INCLUDE is coded after OUTFIL in the input stream.
There is the parameter INCLUDE=, used as part of OUTFIL statement. It has nothing to do with a stand-alone INCLUDE COND= statement. |
|
Back to top |
|
 |
Joerg.Findeisen
Senior Member

Joined: 15 Aug 2015 Posts: 1381 Location: Bamberg, Germany
|
|
|
|
Code: |
//ICETOOL EXEC PGM=ICETOOL
//IN DD *
IBMMAINFRAME.COM|SYNCSORT|DFSORT|XYZCO
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
MODE STOP
COUNT FROM(IN) EMPTY USING(EXCL) RC8
/*
//EXCLCNTL DD *
OMIT COND=(34,5,CH,EQ,C'ABCCO')
/* |
|
|
Back to top |
|
 |
kris_madras
New User

Joined: 04 Jul 2005 Posts: 40
|
|
|
|
Thanks a lot!. the solution worked.
Joerg.Findeisen wrote: |
Code: |
//ICETOOL EXEC PGM=ICETOOL
//IN DD *
IBMMAINFRAME.COM|SYNCSORT|DFSORT|XYZCO
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
MODE STOP
COUNT FROM(IN) EMPTY USING(EXCL) RC8
/*
//EXCLCNTL DD *
OMIT COND=(34,5,CH,EQ,C'ABCCO')
/* |
|
|
|
Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2194 Location: USA
|
|
|
|
kris_madras wrote: |
Thanks a lot!. the solution worked.
Joerg.Findeisen wrote: |
Code: |
//ICETOOL EXEC PGM=ICETOOL
//IN DD *
IBMMAINFRAME.COM|SYNCSORT|DFSORT|XYZCO
/*
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//TOOLIN DD *
MODE STOP
COUNT FROM(IN) EMPTY USING(EXCL) RC8
/*
//EXCLCNTL DD *
OMIT COND=(34,5,CH,EQ,C'ABCCO')
/* |
|
|
I still recommend trying to understand: how SORT really works? (At least: to find out the difference between statements, and parameters.)
Not only being grateful for a ready-to-use solution. |
|
Back to top |
|
 |
|