Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Count of records using ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
mukunthg

New User


Joined: 27 Mar 2007
Posts: 10
Location: India

PostPosted: Mon Feb 18, 2008 7:13 pm    Post subject: Count of records using ICETOOL
Reply with quote

I have my input like this:

Code:

AB 1234 hi
AB 5678 ok
AB 9876 fj
CD 2345 jj
CD 8765 lo
EF 4443 vx


I want my output as:

Code:

AB 3
CD 2
EF 1


How do i do using SORT/ ICETOOL?
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Feb 18, 2008 10:00 pm    Post subject:
Reply with quote

You can use a DFSORT job like this to do what you asked for. You show the count as 1 digit so that's what I gave you. If you want more digits, then just change the EDIT mask accordingly, e.g. EDIT=(TTT) for 3 digits with leading zeros or EDIT=(IIT) for 3 digits without leading zeros.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
AB 1234 hi
AB 5678 ok
AB 9876 fj
CD 2345 jj
CD 8765 lo
EF 4443 vx
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(1,2,
      TRAILER3=(1,3,COUNT=(EDIT=(T))))
/*
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Tue Feb 19, 2008 9:20 am    Post subject: Reply to: Count of records using ICETOOL
Reply with quote

You can also get the desired results by using the below DFSORT JCL

Code:
//VZM1CKKN JOB (3GAHF3,R),                                       
//         'RAJAT TEST',CLASS=X,MSGCLASS=Y,NOTIFY=&SYSUID       
//S1      EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//*                                                             
//IN       DD *                                                 
AB 1234 HI                                                       
AB 5678 OK                                                       
AB 9876 FJ                                                       
CD 2345 JJ                                                       
CD 8765 LO                                                       
EF 4443 VX                                                       
/*
//T1       DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS) 
//T2       DD DSN=&&T2,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS) 
//OUT      DD SYSOUT=*                                           
//TOOLIN   DD *                                                   
    SORT FROM(IN) TO(T1) USING(SRT1)                             
    SPLICE FROM(T1) TO(T2) ON(1,2,CH) WITH(80,6) -               
    KEEPNODUPS                                                   
    COPY FROM(T2) TO(OUT) USING(CPY1)                             
/*                                                               
//SRT1CNTL DD *                                                   
    OPTION COPY                                                   
    SORT FIELDS=(1,2,CH,A)                                       
    OUTREC OVERLAY=(80:SEQNUM,3,ZD,START=1,INCR=1,RESTART=(1,2)) 
/*                                                               
//CPY1CNTL DD *                                                   
    OPTION COPY                                                   
    OUTREC FIELDS=(1,2,5:80,3,72:X)                               
/*                                                               
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Feb 19, 2008 9:27 am    Post subject:
Reply with quote

Hello,

Just curious. . . .

Is there some reason you posted a suggestion that requires multiple passes of the data as well as multiple intermediate work files and requires sorting/merging the data, when the original solution meets the requirement with a single pass of the data and requires no sorting of the data at all?


Are you possibly a hardware salesperson?
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Tue Feb 19, 2008 10:10 am    Post subject:
Reply with quote

Quote:
Are you possibly a hardware salesperson?


No....a developer....


I just answered to this post because I thought of an another idea to do this... I know the JCL poseted by frank is more efficent then mine.... if you feel i did anything wrong then i am sorry...
Back to top
View user's profile Send private message
mukunthg

New User


Joined: 27 Mar 2007
Posts: 10
Location: India

PostPosted: Tue Feb 19, 2008 2:53 pm    Post subject:
Reply with quote

Thanks Frank. It works! icon_smile.gif
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Feb 19, 2008 9:42 pm    Post subject:
Reply with quote

Quote:
Are you possibly a hardware salesperson?


Good one, Dick.

I don't know whether to laugh or cry.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Group elements using ICETOOL Learncoholic DFSORT/ICETOOL 2 Fri Apr 14, 2017 11:01 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us