Sorting dataset with dfsort and icetool



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sorting dataset with dfsort and icetool

Postby makies » Wed May 21, 2008 6:08 pm

Hello

I am a newcomer in the Mainframe world. I have a dataset with name SPORT.TRDATA2. The field locations and the column spaces of the data re fixed. This is the data of a company who has shops in different locations and sells footballs. The first column is the shop location and has range 1,15 , the second field is the year 17.4 the third is the month 23,2 and the last column is the sales 26,7

I want to sort for each month the sales. I have written some JCL statements but my problem is that when i go to SDSF i cannot see the output of the job so i am not sure if the JCL that I wrote is correct.

//MYJOB     JOB 1
//MYSORT    EXEC PGM=SORT
//SORTIN    DD DISP=SHR,DSN=SPORT.TRDATA2
//SORTOUT   DD SYSOUT=*
//SYSOUT    DD SYSOUT=*
//SYSIN     DD *
SORT FIELDS=(1,15,CH,A)
OPTION ZDPRINT
SUM FIELDS=(26,7,ZD)
/*


Is the above correct?? Also how can use icetool to sort this data
makies
 
Posts: 14
Joined: Wed May 21, 2008 5:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting dataset with dfosirt and icetool

Postby Frank Yaeger » Wed May 21, 2008 8:40 pm

You need at least one space before each DFSORT control statement, e.g. replace each b with a space:

bbSORT FIELDS=(1,15,CH,A)
bbOPTION ZDPRINT
bbSUM FIELDS=(26,7,ZD)


These control statements sort by the shop and sum the sales for each shop. That does NOT match your description of what you want to do.

how can use icetool to sort this data


You can use an ICETOOL SORT operator to sort the data. But you don't need to as the PGM=ICEMAN (DFSORT) job will sort it.

Please show an example of the records in your input file and what you expect for the output records. Give the RECFM and LRECL of the input file. Use code tags around the example data.

when i go to SDSF i cannot see the output of the job


I suspect you need to use MSGCLASS=x where x is the class for held output. Ask somebody at your shop about that. We use e MSGCLASS=H here, but it may be different at your shop.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/servers/storage/supp ... tmpub.html
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Sorting dataset with dfosirt and icetool

Postby makies » Wed May 21, 2008 8:49 pm

The dataset is fixed block with LRECL of 41 characters and BLKSIZE 24600
an example of the dataset is
aberporth         2007  7     177
aberporth         2007  8     180
aberporth         2007  9     171
armagh            1970  1      75
armagh            1970  2      68
bradford          1985 12      87
bradford          1986  1      61
bradford          1986  2      16
bradford          1986  3      88
bradford          1986  4      92
bradford          1986  5     156
 


What is RFCM ?? Tha data is fixed block
Thank you very much for your help
makies
 
Posts: 14
Joined: Wed May 21, 2008 5:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting dataset with dfosirt and icetool

Postby Frank Yaeger » Wed May 21, 2008 10:35 pm

What is RFCM ?? Tha data is fixed block


RECFM is record format. If it's fixed blocked then its RECFM=FB.

You showed the input records. Now you need to show the expected output records (as previously requested).
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Sorting dataset with dfosirt and icetool

Postby makies » Wed May 21, 2008 10:50 pm

Also MSGCLASS=H and Class = A

I need to create three datasets reading from the dataset SPORT.TRDATA2 in order to get the following outcomes

Batch job from first dataset

1        345
2        500
3       ......
4
5
6
7
8
9
10
11
12

The first column above are the months and the second column are the total sales

I just need help with that dataset and I soon as I see how this works i will try and to the rest ones. I have read the manuals for DFsort but I couldn't understand much. Thanks for the help
makies
 
Posts: 14
Joined: Wed May 21, 2008 5:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting dataset with dfosirt and icetool

Postby Frank Yaeger » Thu May 22, 2008 12:58 am

Here's a DFSORT job that does what I think you're asking for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
aberporth       2007   7     177
aberporth       2007   8     180
aberporth       2007   9     171
armagh          1970   1      75
armagh          1970   2      68
bradford        1985  12      87
bradford        1986   1      61
bradford        1986   2      16
bradford        1986   3      88
bradford        1986   4      92
bradford        1986   5     156
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  SORT FIELDS=(23,2,ZD,A)
  OPTION ZDPRINT
  SUM FIELDS=(26,7,ZD)
  OUTREC BUILD=(23,2,5X,26,7,ZD,EDIT=(IIIIIIT))
/*


SORTOUT would have:

 1         136   
 2          84   
 3          88   
 4          92   
 5         156   
 7         177   
 8         180   
 9         171   
12         87   
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Sorting dataset with dfosirt and icetool

Postby makies » Thu May 22, 2008 3:32 am

Thanks but because I have to read the data from a file, instead of having

//SORTIN DD *
aberporth       2007   7     177
aberporth       2007   8     180
aberporth       2007   9     171
armagh          1970   1      75
armagh          1970   2      68
bradford        1985  12      87
bradford        1986   1      61
bradford        1986   2      16
bradford        1986   3      88
bradford        1986   4      92


can i have
//SORTIN DD DSN=SPORTS.TRDATA2,DISP=SHR
??
makies
 
Posts: 14
Joined: Wed May 21, 2008 5:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting dataset with dfosirt and icetool

Postby Frank Yaeger » Thu May 22, 2008 3:58 am

Yes, of course (you could have confirmed this by trying it yourself).

I just used DD * to show what the input data looked like. You can use:

//SORTIN DD DSN=SPORTS.TRDATA2,DISP=SHR

You can also use a data set for //SORTOUT instead of SYSOUT=*.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Sorting dataset with dfsort and icetool

Postby makies » Thu May 22, 2008 3:15 pm

Hello
I used the code you've written but i am getting the following error

09.39.46 JOB05347 $HASP165 SUR00161 ENDED AT TSTMVS01 - JCL ERROR CN(INTERNAL)
***
makies
 
Posts: 14
Joined: Wed May 21, 2008 5:51 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting dataset with dfsort and icetool

Postby Frank Yaeger » Thu May 22, 2008 8:41 pm

09.39.46 JOB05347 $HASP165 SUR00161 ENDED AT TSTMVS01 - JCL ERROR CN(INTERNAL)


This a JES message, not a DFSORT message. You need to look at the JES messages to see what's wrong. If you can't figure it out, post your JCL and all of the messages you received here.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Next

Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post