IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Setting RC using NULLOFL/NOTMTOFL for empty,input condition


IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kris_madras

New User


Joined: 04 Jul 2005
Posts: 40

PostPosted: Thu Apr 17, 2025 10:17 pm
Reply with quote

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
Code:
empty file


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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2194
Location: USA

PostPosted: Fri Apr 18, 2025 12:03 am
Reply with quote

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
View user's profile Send private message
kris_madras

New User


Joined: 04 Jul 2005
Posts: 40

PostPosted: Fri Apr 18, 2025 4:53 am
Reply with quote

Yes.. They're parameters for OUTFIL statement. OUTFIL FILES=01 and then followed by include statement mentioned.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2194
Location: USA

PostPosted: Fri Apr 18, 2025 5:29 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1381
Location: Bamberg, Germany

PostPosted: Sat Apr 19, 2025 9:44 am
Reply with quote

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
View user's profile Send private message
kris_madras

New User


Joined: 04 Jul 2005
Posts: 40

PostPosted: Wed Apr 23, 2025 1:09 pm
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2194
Location: USA

PostPosted: Wed Apr 23, 2025 11:20 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Write record twice based on condition... SYNCSORT 5
No new posts Sort to insert record in an empty file. DFSORT/ICETOOL 5
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
Search our Forums:

Back to Top