IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to add And count in sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Himanshu-kaushik

New User


Joined: 15 Mar 2007
Posts: 8
Location: delhi

PostPosted: Mon Oct 12, 2009 5:27 pm
Reply with quote

Hi,

I have a requirement. I have an input file which is having employee name and their salary. i need to sort them acceding order of there name and in the end i need to give the count of total employee as well as total salary given to them. I need to do it through JCL only.

Sample file
Code:

Amar 10000.00
vijay 10000.00
ajay 10000.00
kapoor 12000.00



Answer
ajay 10000.00
Amar 10000.00
kapoor 12000.00
vijay 10000.00
04 42000.00
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Mon Oct 12, 2009 9:05 pm
Reply with quote

Himanshu,

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
amar           10000.00
vijay          10000.00
ajay           10000.00
kapoor         12000.00
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(1,4,CH,A)
  OUTFIL REMOVECC,
    TRAILER1=(COUNT=(M11,LENGTH=2),X,
      TOT=(16,8,UFF,EDIT=(TTTTT.TT)))
/*
Back to top
View user's profile Send private message
Himanshu-kaushik

New User


Joined: 15 Mar 2007
Posts: 8
Location: delhi

PostPosted: Wed Oct 14, 2009 5:00 pm
Reply with quote

Hi Frank,

I am getting error while running above JCL. It is Saying Report Field Error on UEF. IS UEF is Correct. Check the Error.

Code:

ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 16:50 ON THU OCT
           SORT FIELDS=(1,15,CH,A)                                             
           OUTFIL REMOVECC,                                                     
           TRAILER1=(COUNT=(M11,LENGTH=2),X,                                   
              TOT=(16,8,UEF,EDIT=(TTTTT.TT)))                                   
                        $                                                       
ICE223A 0 REPORT FIELD ERROR
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Oct 14, 2009 5:34 pm
Reply with quote

Himanshu Kaushik,

TOT=(16,8,UFF,EDIT=(TTTTT.TT)))
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed Oct 14, 2009 10:05 pm
Reply with quote

Quote:
IS UEF is Correct


Interesting that you diagnosed the error from the error message, but weren't able to go back to my original post to see that I had UFF and you had UEF and answer your own question.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts To get the count of rows for every 1 ... DB2 3
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top