MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Count number of records from specific group of records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 3:35 am    Post subject: Count number of records from specific group of records Reply with quote

Hi,

I have requriment in which i need to count number of records from set of batch numbers like i need to know how many trasactions are there for 917474 , 571144 , 571145 .

And display them like

No of trasactions for 917474 : 5
No of trasactions for 571144 : 7
No of trasactions for 571145 : 4

BATCH TYPE NUMBER
917474 CLOSE 62200202992
917474 WRITE 62200202992
917474 WRITE 62200202992
917474 WRITE 62200202992
917474 WRITE 62200202992
571144 CLOSE 221032906994
571144 WRITE 221032906994
571144 WRITE 221032906994
571144 WRITE 221032906994
571144 CLOSE 221032906994
571144 WRITE 221032906994
571144 WRITE 221032906994
571145 CLOSE 221032906995
571145 WRITE 221032906995
571145 WRITE 221032906995
571145 WRITE 221032906995


Thanks,
Siva
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Thu Oct 30, 2008 3:58 am    Post subject: Reply with quote

Well, it is in the manual because I have this which I developed from reading the manual:
Code:

//COPY1    EXEC PGM=ICETOOL                                                     
//* PRODUCE a report on the occurrences of value(s)                           
//TOOLMSG   DD SYSOUT=*                                                         
//DFSMSG    DD SYSOUT=*                                                         
//IN        DD DSN=your.input.file,                                   
//             DISP=SHR                                                                     
//REPORT8   DD DSN=KAS.A04376.ICETOOL.REPORT8,                                 
//             DISP=(,CATLG,CATLG),                                             
//             SPACE=(TRK,(1,1),RLSE),                                         
//             UNIT=WORKP                                                       
//TOOLIN    DD *
 OCCURS                                                     -                   
    FROM(IN)                                                -                   
    LIST(REPORT8)                                           -                   
    TITLE('Accts present on this file')                      -                   
    BLANK                                                   -                   
    HEADER(,'Acc  ')                   ON(1,6,ZD,E'999999') -                   
    HEADER('Number of','Transactions') ON(VALCNT)                               
*------------------------------------------------                               
* OUTPUT AS WRITTEN TO FILE REPORT8:                                           
* ----+----1----+----2----+----3----+-                                         
*------------------------------------------------                               
* Accts present on this file                                                     
*                                                                               
*                Number of                                                     
*  ACC        Transactions                                                     
* ------   ---------------                                                     
* 123456                23                                                     
* 234567                 1                                                     
* 345678                31                                                     
* 456789                 1                                                     


All you have to do is tailor it to your requirements
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 7:46 am    Post subject: Reply with quote

Hi Nic Clouston,

Thanks for your help.. It really helps .

Siva
Back to top
View user's profile Send private message
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 8:03 am    Post subject: Reply with quote

Hi Nic Clouston,

The above code is working fine for numberic values . what if we have values like this 003E5968,002A1290( i.e. alpha numberic) values under batch number.What should be for this (1,6,ZD,E'999999') in case of alpha numberic values.


Thanks,
Siva
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Oct 30, 2008 10:21 am    Post subject: Reply with quote

Siva,

Just treat those as character (CH):

ON(1,8,CH)

Actually, for the original example you showed, you could treat the numeric values as CH as well.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 10:33 am    Post subject: Reply with quote

Hi Frank,

Thanks For your help.....


I have another query of type.I have following data in my file
Code:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
000825520012881     00004RB6  JE1100000000002JF1700000000000006286H.....
000825520012881     00004RB6  H812081029194957AA164271780656335073A.....
000825520012881     00004RB6  H812081029194957AA164050480881432814A.....
000825520012881     00783959  JE1100000000003JF1700000000000011500H.....
000367216394885     00783959  H812081029200720AA164337183017120551A.....
000367216394885     00783959  H812081029200720AA164744750001656936A.....
000367216394885     00783959  H812081029200720AA164828552944467010A.....

I need to exact the JE11 & JF17 (pos 31 & pos 46) from the file and display like this

No of Trasactions : 00000000002
Total amount : 00000000000006286
No of Trasactions : 00000000003
Total amount : 00000000000001500


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Thu Oct 30, 2008 10:52 am    Post subject: Reply with quote

sivadfms,

please use code blocks and mention the positions. I edited your post to be in the readable format. The following DFSORT JCL will give you desired results

Code:

//STEP0100 EXEC  PGM=SORT                                               
//SYSOUT   DD SYSOUT=*                                                 
//SORTIN   DD *                                                         
000825520012881     00004RB6  JE1100000000002JF1700000000000006286H.....
000825520012881     00004RB6  XXXY12345678901JF1712345678901234567H.....
000825520012881     00004RB6  H812081029194957AA164271780656335073A.....
000825520012881     00004RB6  H812081029194957AA164050480881432814A.....
000825520012881     00783959  JE1100000000003JF1700000000000011500H.....
000367216394885     00783959  H812081029200720AA164337183017120551A.....
000367216394885     00783959  H812081029200720AA164744750001656936A.....
000367216394885     00783959  H812081029200720AA164828552944467010A.....
//SORTOUT  DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
 INCLUDE COND=(31,4,CH,EQ,C'JE11',AND,46,4,CH,EQ,C'JF17')               
 SORT FIELDS=COPY                                                       
 OUTFIL BUILD=(C'NO OF TRASACTIONS : ',35,11,/,                         
               C'TOTAL AMOUNT      : ',50,17)                           
/*


The output is

Code:

NO OF TRASACTIONS : 00000000002         
TOTAL AMOUNT      : 00000000000006286   
NO OF TRASACTIONS : 00000000003         
TOTAL AMOUNT      : 00000000000011500   


Hope this helps...

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 11:03 am    Post subject: Reply with quote

Hi kolusu

When i tried to run the above jcl.It is giving following error

-------- PROCESSING SYSIN --------
INCLUDE COND=(31,4,CH,EQ,C'JE11',AND,46,4,CH,EQ,C'JF17')
SORT FIELDS=COPY
OUTFIL BUILD=(C'NO OF TRASACTIONS : ',35,11,/,
C'TOTAL AMOUNT : ',50,17)
E1 - DSS20011E - DD 'SORTOUT' WAS NOT ALLOCATED.
E2 - DSS10065E - PARAMETER 'BUILD' IS UNIDENTIFIED.

------- END OF UTILITY PROGRAM OUTPUT -------


Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Thu Oct 30, 2008 11:05 am    Post subject: Reply with quote

sivafdms,

Quote:
When i tried to run the above jcl.It is giving following error


1. They are not DFSORT error messages

2.You did NOT run the job yet. You only did a JCL check with a JCL CHECK product which is not updated with the latest features of DFSORT.

Run the job and let me know if you have a problem
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sivafdms
Intermediate


Joined: 29 May 2007
Posts: 165
Topics: 77

PostPosted: Thu Oct 30, 2008 9:46 pm    Post subject: Reply with quote

Hi Kolusu,

It is working fine for FB file but when i use the same input in VB it is giving following error.
Code:

SORTIN   : RECFM=VB   ; LRECL=  4100; BLKSIZE= 27998   
SORTOUT  OUTREC RDW NOT INCLUDED                       
SYNCSMF  CALLED BY SYNCSORT; RC=0000                   
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE

i tried this control card
Code:

INCLUDE COND=(273,4,CH,EQ,C'JE11',AND,288,4,CH,EQ,C'JF17')
SORT FIELDS=COPY                                           
OUTFIL BUILD=(C'NO OF TRASACTIONS : ',277,11,/,           
              C'TOTAL AMOUNT      : ',292,17)             

what do we need to include for this run smoothly.

Thanks,
Siva
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12382
Topics: 75
Location: San Jose

PostPosted: Fri Oct 31, 2008 10:31 am    Post subject: Reply with quote

sivafdms,

Your error messages indicate that you are using Syncsort.

I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.

Thanks
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Fri Oct 31, 2008 11:56 am    Post subject: Reply with quote

Quote:
SORTOUT OUTREC RDW NOT INCLUDED

This is pretty self explanatory. For a VB file, you must include the RDW (1,4) in OUTREC... unless you are converting it to an FB file... which requires additional coding as well.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group