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

listing sum if zero


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sapfisher

New User


Joined: 17 Aug 2017
Posts: 3
Location: usa

PostPosted: Tue Jul 24, 2018 3:18 am
Reply with quote

I have searched forums, manuals, google . . . I need advice!.

I am trying to count the number of various types of records using sort. It works just fine if there ARE the type of record found in the file, but if there are none, it doesn't list anything. Is there any way to make it TELL me that there are none? This is what I'm using:
Code:

INREC FIELDS=(1,1,             INDICATOR                         
              C'00000000001',  COUNT                             
              48,1,            INDICATOR                         
              99,6)            INDICATOR                         
SORT FIELDS=(1,1,CH,A)                                           
INCLUDE COND=(99,6,CH,EQ,C'REJECT',AND,48,1,CH,EQ,C'E')           
SUM   FIELDS=(2,11,ZD)                                           
OUTREC FIELDS=(1:C'Encounter INVALID -',                         
              21:2,11,ZD,M12,                                     
              36:C'                                            ')
As I said, as long as it does find some, it will give me the count, but there aren't always invalid records found, and I want it to SAY that there were none. Suggestions?

Please use the code tags as shown below to make your code easy to read on here. Have done it for you here.
Code:

[code]
your
stuff
in
here
[/code]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8794
Location: Welsh Wales

PostPosted: Tue Jul 24, 2018 11:41 am
Reply with quote

Does it not issue RC 4 with no records selected ?

If so, you can use that for IF / ELSE processing later in the job
If not, have a look at the options as I'm sure you can get it to.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 924
Location: Maryland

PostPosted: Tue Jul 24, 2018 5:01 pm
Reply with quote

Code:

 OUTFIL NULLOFL=RC4,      to "say" via CC=4
        TRAILER1=('TOTAL RECORDS FOUND =',COUNT)  to "say" in words
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1348
Location: Israel

PostPosted: Wed Jul 25, 2018 5:24 pm
Reply with quote

This works as well:
Code:
  SORT FIELDS=COPY
  OUTFIL INCLUDE=(99,6,CH,EQ,C'REJECT',AND,48,1,CH,EQ,C'E'),
    NODETAIL,TRAILER1=(C'TOTAL REJECTS: ',COUNT=(M10,LENGTH=10))
Back to top
View user's profile Send private message
sapfisher

New User


Joined: 17 Aug 2017
Posts: 3
Location: usa

PostPosted: Fri Jul 27, 2018 10:17 pm
Reply with quote

Marso wrote:
This works as well:
Code:
  SORT FIELDS=COPY
  OUTFIL INCLUDE=(99,6,CH,EQ,C'REJECT',AND,48,1,CH,EQ,C'E'),
    NODETAIL,TRAILER1=(C'TOTAL REJECTS: ',COUNT=(M10,LENGTH=10))



That works perfectly! Thank you!!

icon_biggrin.gif
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts how to show listing in physical locat... PL/I & Assembler 2
No new posts Listing EVERY Dataset on a system All Other Mainframe Topics 4
No new posts Parsing and Listing a Subset of Recor... IBM Tools 3
No new posts Rexx code that expands changeman comp... CLIST & REXX 0
No new posts Dataset attributes listing DFSORT/ICETOOL 9
Search our Forums:

Back to Top