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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

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