Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
listing sum if zero

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: listing sum if zero
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: 8704
Location: Back in jolly old England

PostPosted: Tue Jul 24, 2018 11:41 am    Post subject:
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 User


Joined: 29 Apr 2008
Posts: 340
Location: Maryland

PostPosted: Tue Jul 24, 2018 5:01 pm    Post subject:
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: 1292
Location: Israel

PostPosted: Wed Jul 25, 2018 5:24 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Parsing and Listing a Subset of Recor... Charles Wolters IBM Tools 3 Fri Feb 05, 2016 10:39 pm
No new posts Rexx code that expands changeman comp... Gopalakrishnan V CLIST & REXX 0 Thu Jan 08, 2015 11:31 am
No new posts Dataset attributes listing V S Amarendra Reddy DFSORT/ICETOOL 9 Thu Nov 14, 2013 3:54 am
No new posts How to find historical compressed lis... Joyce CA Products 0 Tue Sep 17, 2013 7:41 am
No new posts create compile listing from cobol pro... t5590ag COBOL Programming 9 Tue Aug 13, 2013 8:19 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us