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
 

 

How to add And count in sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to add And count in sort
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 Moderator


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

PostPosted: Mon Oct 12, 2009 9:05 pm    Post subject:
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    Post subject: How to add And count in sort
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    Post subject:
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 Moderator


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

PostPosted: Wed Oct 14, 2009 10:05 pm    Post subject:
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    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 Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts Display FTP Session Count within TSO Yolanda Harvey TSO/ISPF 3 Fri Mar 10, 2017 10:31 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm


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