IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

extract maximum value from a sequntial file thru syncsort


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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
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
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 All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts IGYPG3178-I when compiling a pgm read... COBOL Programming 6
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Sorting date into YYYYMMDD, and creat... DFSORT/ICETOOL 13
No new posts To Sort detail records in a file with... SYNCSORT 5
No new posts To Populate Trailer cnt in the file w... SYNCSORT 1
Search our Forums:


Back to Top