Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Spool Extract for Z /os 1.04 version Khadhar Basha CLIST & REXX 3 Thu Sep 28, 2017 3:14 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us