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 

need to get the count of records

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


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Wed Apr 01, 2009 5:45 pm    Post subject: need to get the count of records Reply with quote

I have a file with records as below and the file is ordered by first three bytes:
Code:

ABC IL
ABC TX
ABC IL
DEF IL   
DEF FL
.
.
.


I want the output as below in order of first 3 bytes and within that state should be ordered ascending , the numbers indicate how many times state has occured.
Code:

ABC IL     2
ABC TX     1
DEF FL     1   
DEF IL     1   
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Apr 01, 2009 6:36 pm    Post subject: Reply with quote

yadav2005,

The following DFSORT JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                       
//SYSOUT   DD SYSOUT=*                         
//SORTIN   DD *                               
----+----1----+----2----+----3----+----4----+--
ABC IL                                         
ABC TX                                         
ABC IL                                         
DEF IL                                         
DEF FL                                         
//SORTOUT  DD SYSOUT=*                         
//SYSIN    DD *                               
  OPTION EQUALS                               
  SORT FIELDS=(1,3,CH,A,     $ KEY ASC         
               5,2,CH,A)     $ STATE ASC       
                                               
  OUTFIL REMOVECC,NODETAIL,                   
  SECTIONS=(1,3,5,2,                           
  TRAILER3=(1,3,X,5,2,X,COUNT=(M10,LENGTH=5)))
/*

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


Joined: 10 Jan 2005
Posts: 348
Topics: 144

PostPosted: Wed Apr 01, 2009 6:49 pm    Post subject: Reply with quote

Thanks Kolusu for the needful help.
Back to top
View user's profile Send private message
Shankarganesh_gopal
Beginner


Joined: 24 May 2005
Posts: 36
Topics: 20
Location: chennai

PostPosted: Mon Apr 27, 2009 1:18 am    Post subject: Reply with quote

Hello,

I tried with your example and it failed with the following error

Code:

            OUTFIL REMOVECC,NODETAIL,
           SECTIONS=(1,3,5,2,
                         $
ICE223A F REPORT FIELD ERROR
           TRAILER3=(1,3,X,5,2,X,COUNT=(M10,LENGTH=5)))
           $
Back to top
View user's profile Send private message
mainframemouli
Beginner


Joined: 23 Feb 2005
Posts: 87
Topics: 33

PostPosted: Mon Apr 27, 2009 1:50 am    Post subject: Reply with quote

Please try the below :

Code:

//STEP0010 EXEC PGM=ICETOOL                               
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//INPHI   DD *                                           
ABC IL                                                   
ABC TX                                                   
ABC IL                                                   
DEF IL                                                   
DEF FL                                                   
ABC TX                                                   
//OUTPHI  DD SYSOUT=*                                     
//TOOLIN  DD *                                           
 OCCUR FROM(INPHI) LIST(OUTPHI) NOHEADER BETWEEN(1) -     
   ON(1,06,CH) ON(VALCNT,E'9999')                         
/*                                                       
//*                                                       
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: Mon Apr 27, 2009 10:20 am    Post subject: Reply with quote

Shankarganesh,

That error indicates you don't have z/OS DFSORT V1R5 PTF UK90013 (July, 2008). Ask your System Programmer to install it. In the meantime, you can bypass the error by using these control statements:

Code:

  OPTION COPY                                         
   OUTFIL REMOVECC,NODETAIL,                         
     SECTIONS=(1,3,SKIP=0L,5,2,                       
     TRAILER3=(1,3,X,5,2,X,COUNT=(M10,LENGTH=5)))     

_________________
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
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