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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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