|
View previous topic :: View next topic
|
| Author |
Message |
sapfisher
New User
Joined: 17 Aug 2017 Posts: 3 Location: usa
|
|
|
|
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 |
|
 |
expat
Global Moderator

Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2286 Location: USA
|
|
|
|
| Code: |
OUTFIL NULLOFL=RC4, to "say" via CC=4
TRAILER1=('TOTAL RECORDS FOUND =',COUNT) to "say" in words
|
|
|
| Back to top |
|
 |
Marso
REXX Moderator

Joined: 13 Mar 2006 Posts: 1356 Location: Israel
|
|
|
|
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 |
|
 |
sapfisher
New User
Joined: 17 Aug 2017 Posts: 3 Location: usa
|
|
|
|
| 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!!
 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|