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
 

 

extract maximum value from a sequntial file thru syncsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
vivekanand
Warnings : 1

New User


Joined: 23 Feb 2006
Posts: 2
Location: Bangalore

PostPosted: Thu Feb 23, 2006 8:51 pm    Post subject: extract maximum value from a sequntial file thru syncsort
Reply with quote

Hi ,

I am trying to extract a maximum value from a list of value in a sequential file thru Syncsort .

Codition is as follows,

Input file records

Report-1 101
Report-1 200
Report-1 205
Report-1 500
Report-1 400

Required Output File

Report-1 500

pls share your ideas on this requirement
Back to top
View user's profile Send private message

Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Fri Feb 24, 2006 11:17 am    Post subject:
Reply with quote

Hi,

Please execute the following steps.
Code:

//STEP01  EXEC  PGM=SORT                             
//SORTIN   DD  DSN=&HLQ..INPUT.FILE,   *input file           
//             DISP=SHR                             
//SORTOUT  DD  DSN=&&TEMP,                           
//             DISP=(NEW,PASS),                     
//             UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
//             DCB=(*.SORTIN)                       
//SYSIN  DD  *                                       
 SORT FIELDS=(10,3,CH,D)                             
 SUM FIELDS=NONE                                     
/*                                                   
//STEP02  EXEC  PGM=SORT                             
//SORTIN   DD  DSN=&&TEMP,                           
//             DISP=(OLD,PASS)                       
//SORTOUT  DD  DSN=A021680.OUTPUT.FILE,   *Output file           
//             DISP=(NEW,CATLG,DELETE),             
//             UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
//             DCB=(*.SORTIN)                       
//SYSIN  DD  *                                       
 SORT FIELDS=COPY,STOPAFT=1                         
/*                                                   


Thanks.
Ayyappan
Back to top
View user's profile Send private message
bonniem

New User


Joined: 09 Aug 2005
Posts: 67

PostPosted: Fri Feb 24, 2006 11:20 am    Post subject: Re: extract maximum value from a sequntial file thru syncsor
Reply with quote

Dont you think the output of first step would be only the first line, ie
Report-1 101?
Back to top
View user's profile Send private message
Ayyappan

New User


Joined: 05 Jul 2005
Posts: 31
Location: India

PostPosted: Fri Feb 24, 2006 11:30 am    Post subject:
Reply with quote

Hi,

As i am sorting it in descending oreder, the first line will be the maximum value.

Thanks.
Ayyappan
Back to top
View user's profile Send private message
vivekanand
Warnings : 1

New User


Joined: 23 Feb 2006
Posts: 2
Location: Bangalore

PostPosted: Fri Feb 24, 2006 8:04 pm    Post subject: Thanks for your solution
Reply with quote

Thanks for your solution.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm


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