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
How To display the count based on a specific string?
Re: How To display the count based on a specific string?
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
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
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How To display the count based on a specific string?
RTFM about OUTFIL SECTIONS=
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How To display the count based on a specific string?
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Replace a string with another string with different length
by Devrana » Sun Jan 19, 2025 3:23 pm » in JCL - 1
- 1621
-
by sergeyken
View the latest post
Sun Jan 19, 2025 11:07 pm
-
-
-
Process file/records until a specific total is reached.
by chillmo » Thu Mar 24, 2022 6:18 am » in Syncsort/Synctool - 12
- 3704
-
by sergeyken
View the latest post
Wed Mar 30, 2022 10:12 pm
-
-
- 1
- 6544
-
by prino
View the latest post
Mon Mar 21, 2022 8:18 pm
-
- 7
- 11350
-
by AusZosGuy
View the latest post
Fri Sep 10, 2021 6:40 pm
-
- 2
- 2363
-
by Murali_721
View the latest post
Thu Nov 19, 2020 4:24 pm