MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get only the greater value??

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Roke
Beginner


Joined: 24 Feb 2005
Posts: 8
Topics: 3

PostPosted: Thu Feb 24, 2005 4:37 am    Post subject: How to get only the greater value?? Reply with quote

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
View user's profile Send private message
programmer1
Beginner


Joined: 18 Feb 2004
Posts: 138
Topics: 14

PostPosted: Thu Feb 24, 2005 4:44 am    Post subject: Reply with quote

Sort the data in descending order and pick the greater values from the top ?
_________________
Regards,
Programmer
Back to top
View user's profile Send private message
Roke
Beginner


Joined: 24 Feb 2005
Posts: 8
Topics: 3

PostPosted: Thu Feb 24, 2005 4:48 am    Post subject: Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Feb 24, 2005 6:33 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Roke
Beginner


Joined: 24 Feb 2005
Posts: 8
Topics: 3

PostPosted: Thu Feb 24, 2005 6:50 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Thu Feb 24, 2005 8:45 am    Post subject: Reply with quote

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

Code:

2005-02-05


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Feb 24, 2005 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group