View previous topic :: View next topic |
Author |
Message |
Roke Beginner
Joined: 24 Feb 2005 Posts: 8 Topics: 3
|
Posted: Thu Feb 24, 2005 4:37 am Post subject: How to get only the greater value?? |
|
|
Hi,
I need to get the greater value in the same procces in jcl.
How can i do it??
The data set contains only values like this : 2005/01/01
Thank you. |
|
Back to top |
|
 |
programmer1 Beginner
Joined: 18 Feb 2004 Posts: 138 Topics: 14
|
Posted: Thu Feb 24, 2005 4:44 am Post subject: |
|
|
Sort the data in descending order and pick the greater values from the top ? _________________ Regards,
Programmer |
|
Back to top |
|
 |
Roke Beginner
Joined: 24 Feb 2005 Posts: 8 Topics: 3
|
Posted: Thu Feb 24, 2005 4:48 am Post subject: |
|
|
Its the idea order with sort and cut the first register with stopatf.
This idea is in 2 steps and i need this in one step. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Feb 24, 2005 6:33 am Post subject: |
|
|
Roke,
Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.
Please post a sample input and desired output along with DCB parameters(LRecl, recfm) and position of the string to be processed
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Roke Beginner
Joined: 24 Feb 2005 Posts: 8 Topics: 3
|
Posted: Thu Feb 24, 2005 6:50 am Post subject: |
|
|
Oks, sorry for my english.
I have a data set with this registers:
2004-12-31
2004-09-11
2005-01-01
2005-02-05
For example and i want a jcl that can take the greater date, the result should be a data set that contains "2005-02-05"
But the problem is that i have to all in the same step in the jcl because the jcl have a lot steps and i can write only one step more.
Sorry for my bads explications but my english isnt very well  |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Feb 24, 2005 8:45 am Post subject: |
|
|
Roke,
The following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2004-12-31
2004-09-11
2005-01-01
2005-02-05
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=(1,10,CH,D) $ sort on date Descending
OUTFIL ENDREC=1 $ write only one record
/*
|
The sortout will now have only one record which is
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Feb 24, 2005 11:43 am Post subject: |
|
|
Here's a DFSORT job that does the same thing using COPY instead of SORT. It uses the new UFF (unsigned free form) format available with z/OS DFSORT V1R5 PTF UQ95214 and DFSORT R14 PTF UQ95213 (Dec, 2004).
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
2004-12-31
2004-09-11
2005-01-01
2005-02-05
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL REMOVECC,NODETAIL,
TRAILER1=(MAX=(1,10,UFF,EDIT=(TTTT-TT-TT)))
/*
|
For complete information on the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:
www.ibm.com/servers/storage/support/software/sort/mvs/pdug/ _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
|
|