View previous topic :: View next topic
|
Author |
Message |
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
plz tell me how to sort numerci values in jcl |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Please tell us what exactly u want to do? U want to sort numeric field then please provide offset & position of that field.
Please show us an example so that we can help u out. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Star,
You would use a DFSORT job like this::
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
SORT FIELDS=(p,m,f,a)
/*
|
For the field you want to sort on (key), p is the starting position, m is the length, f is the format and a is A for ascending sequence or D for descending sequence.
If you don't know which format (f) to use, show us what the values to be sorted look like.
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:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
well i have an instream data as
Code: |
1
4
3
2
5
10
7
9
8
6
|
no the prob is if i use iceman then i have to write
Code: |
SORT FIELDS=(1,2,CH,A)
|
but out of this is
Code: |
1
10
2
3
4
5
6
7
8
9
|
which is not correct. I want a better solution for this. Plz help me for this. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi There,
Try this
SORT FIELDS=(1,2,FS,A)
Hope it will helpful |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Star,
Since your numbers are left-aligned rather than right-aligned, CH won't work. Neither will FS, contrary to what Ekta says. You need DFSORT's UFF (unsigned free form) format to sort left-aligned numbers.
Code: |
SORT FIELDS=(1,2,UFF,A)
|
For more information on DFSORT's UFF and SFF formats, see:
www.ibm.com/servers/storage/support/software/sort/mvs/pdug/ |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
Code: |
SORT FIELDS=(1,2,UFF,A) |
THIS GIVES ERROR. ANYONE ELSE CAN HELP ME FOR THIS. |
|
Back to top |
|
|
prafull
New User
Joined: 08 Dec 2006 Posts: 48
|
|
|
|
SORT FIELDS=(1,2,UFF,A)
the syntax is correct and works everywhere..
star, there must be some other problem with your data.. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Please post the jcl for the sort as well as the error message(s). |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
THIS GIVES ERROR. ANYONE ELSE CAN HELP ME FOR THIS. |
That control statement works fine with DFSORT providing you have at least one blank before SORT. You need to show the //SYSOUT messages you received. Without that, I'd just be guessing at what your problem is. |
|
Back to top |
|
|
star_dhruv2000
New User
Joined: 03 Nov 2006 Posts: 87 Location: Plymouth, MN USA
|
|
|
|
This is my jcl
Code: |
//MTPLD06H JOB NOTIFY=&SYSUID
//STEP1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD *
1
3
2
5
10
4
6
//SORTOUT DD SYSOUT=*
//SORTOUT1 DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,2,UFF,A)
/* |
This is the error i get with max return code 16
Code: |
ICE000I J - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 23:39 ON THU DEC
SORT FIELDS=(1,2,UFF,A)
$
ICE018A M INVALID OR MISSING FORMAT
ICE052I J END OF DFSORT |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The error message indicates that your site does not have DFSORT R14 PTF UQ95213 installed. You need that PTF to use UFF format. That PTF has been available since Dec, 2004 so your site is way behind in applying DFSORT service. Ask your System Programmer to install DFSORT R14 PTF UK90006 (April, 2006). That will get you all of the latest DFSORT functions.
For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
Use [URL] BBCode for External Links
For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
|