How To display the count based on a specific string?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How To display the count based on a specific string?

Postby Chintu333 » Fri Aug 19, 2022 12:59 am

Hello All,

I have a requirement of getting the count of records from an input file based on a particular field value.
For example.

If in column 10 of input file there exists values as A, B, and C, I need to take the count as below:

Count of records that has value A in column 10
Count of records that has value B in column 10
Count of records that has value C in column 10

I want to display these counts separately in the same file.

Sample output file should look like.

Count of A rec. Count of B rec Count of C
500. 600. 200.


Can we do this using the Dfsort Trailer1=Count operator?Please advise.

Thanks
Chintu333
 
Posts: 2
Joined: Fri Aug 19, 2022 12:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To display the count based on a specific string?

Postby Chintu333 » Fri Aug 19, 2022 1:41 am

EDIT POST:

Hello All,

I have a requirement of getting the count of records from an input file based on a particular field value.
For example.

If in column 10 of input file there exists values as A, B, and C, and in column 15 there's indicator as Y or N, I need to take the count as below:

Count of records that has value A in column 10 with indicator Y
Count of records that has value B in column 10 with indicator N
Count of records that has value C in column 10 indicator N

I want to display these counts separately in the same file.

Sample output file should look like.

Count of A rec with Indicator Y
600
Count of B rec with indicator N
500
Count of C rec with Indicator N
200


Can we do this using the Dfsort Trailer1=Count operator?Please advise.

SORRY, I COULD NOT FIND ANY EDIT POST BUTTON. SO REPOSTING AS A REPLY

Thanks
Chintu333
 
Posts: 2
Joined: Fri Aug 19, 2022 12:47 am
Has thanked: 0 time
Been thanked: 0 time

Re: How To display the count based on a specific string?

Postby sergeyken » Fri Aug 19, 2022 3:00 am

RTFM about OUTFIL SECTIONS=
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: How To display the count based on a specific string?

Postby sergeyken » Fri Aug 19, 2022 8:52 pm

Chintu333 wrote:SORRY, I COULD NOT FIND ANY EDIT POST BUTTON. SO REPOSTING AS A REPLY

The EDIT button can be found at the right top corner of your previous post, but only during 30 minutes after its posting.

After 30 minutes the ability to edit your post is blocked.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 438
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post