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 

subtotals in out put file with format -ICETOOL-reqd sort cod

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


Joined: 14 May 2006
Posts: 40
Topics: 18

PostPosted: Mon Dec 03, 2007 4:45 am    Post subject: subtotals in out put file with format -ICETOOL-reqd sort cod Reply with quote

Hi,

I have input like below
Code:

401SC2
401501
402SC2
402SC2
403501
403501
403501

401 - org, sc2 is mode,
I want to get a out put file with below
Code:

401SC2 01
401501  01
402SC2 02
403501  03

is any body provide me the code in using ICETOOL.

Regards
Prasanth Thavva
_________________
Thanks&Regards
Prasanth Thavva
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Mon Dec 03, 2007 9:26 am    Post subject: Reply with quote

prasanth_thavva,

One step solution:

Code:


//STEP0100 EXEC PGM=ICETOOL               
//TOOLMSG  DD SYSOUT=*                   
//DFSMSG   DD SYSOUT=*                   
//IN       DD *                           
401SC2                                   
401501                                   
402SC2                                   
402SC2                                   
403501                                   
403501                                   
403501                                   
//OUT DD SYSOUT=*                         
//TOOLMSG  DD SYSOUT=*                   
//DFSMSG   DD SYSOUT=*                   
//TOOLIN   DD *                           
  SORT FROM(IN)   TO(OUT) USING(CTL1)     
/*                                       
//CTL1CNTL DD *                           
  SORT FIELDS=(1,6,CH,A)                 
  INREC FIELDS=(1,6,C'  01')             
  SUM FIELDS=(9,2,ZD) 
/*                     


_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
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: Mon Dec 03, 2007 11:20 am    Post subject: Reply with quote

prasanth_thavva,

Here is a DFSORT JCL which would give you the desired results.

Code:

//STEP0100 EXEC PGM=ICEMAN           
//SYSOUT   DD SYSOUT=*             
//SORTIN   DD *                   
401SC2                             
401501                             
402SC2                             
402SC2                             
403501                             
403501                             
403501                             
//SORTOUT  DD SYSOUT=*             
//SYSIN    DD *                   
  SORT FIELDS=(01,06,CH,A)         
  OUTFIL REMOVECC,NODETAIL,       
  SECTIONS=(01,06,                 
  TRAILER3=(01,06,X,               
            COUNT=(M11,LENGTH=3)))
//*                               


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
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Dec 03, 2007 11:45 am    Post subject: Reply with quote

Here's another way to do it with the OCCUR operator of DFSORT's ICETOOL:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
401SC2
401501
402SC2
402SC2
403501
403501
403501
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
 OCCUR FROM(IN) LIST(OUT) NOHEADER BETWEEN(1) -
   ON(1,6,CH) ON(VALCNT,E'999')
/*

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


Joined: 14 May 2006
Posts: 40
Topics: 18

PostPosted: Tue Dec 04, 2007 5:52 am    Post subject: Reply with quote

VALCNT,E'999' - will only shows the count lesser than 999., if the count greater it will discard the no. so will you have mechanizm to capture the size of no. and change it to a format.

Thanks for your great effor.

Regards
Prasanth
_________________
Thanks&Regards
Prasanth Thavva
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Tue Dec 04, 2007 6:45 am    Post subject: Reply with quote

prasanth_thavva,

Quote:

VALCNT,E'999' - will only shows the count lesser than 999., if the count greater it will discard the no. so will you have mechanizm to capture the size of no. and change it to a format.


U just have to change the format to your requirement.

You can change the format like :

VALCNT,E'99999999'for a count lesser than 99999999.

Hope this helps..
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
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: Tue Dec 04, 2007 10:58 am    Post subject: Reply with quote

Quote:
VALCNT,E'999' - will only shows the count lesser than 999., if the count greater it will discard the no. so will you have mechanizm to capture the size of no. and change it to a format.


You showed two digits in your output example, so I set up the job to give you three digits. If you need more digits, just use as many 9s as you want up to 31. You can also use other DISPLAY formatting options to format the output count differently if appropriate (e.g. A0, U08, etc).

Quote:
Not sure as to what OP wants. I thought that he want to repeat two chars from second pos.


Kolusu and I assumed that the OP wanted a count of the records with each unique 6 character value. For example, there are two records with the value '402SC2', so the output for that should be one record with '402SC2' and a count of 2.
_________________
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