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
 
Fetch data Through input file with out duplication.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Direction

New User


Joined: 15 Sep 2005
Posts: 11

PostPosted: Mon Dec 26, 2005 3:04 pm    Post subject: Fetch data Through input file with out duplication.
Reply with quote

Hi all,

I had query in JCL. I want to fetch the data from input file and write to output file. Here is the test data.

ITEM TIMESTAMP
123 123456
122 123457
121 123459
121 123460
121 123461

Ouput will be:

123 123456
122 123457
121 123461

I have to get the unique value for Item, If there is multiple occurence for item like 121 than I have select the line with latest timestamp or with highest TIMESTAMP VALUE, ignoring the other values.

I want to do it through JCL, can u all help me out.
Back to top
View user's profile Send private message

sunish

New User


Joined: 23 May 2005
Posts: 19

PostPosted: Mon Dec 26, 2005 5:55 pm    Post subject: Re: Fetch data Through input file with out duplication.
Reply with quote

hi

this is the jcl

//sysprint dd sysout=*
//sysin dd *
sort fields=(1,3,ch,a)
sumfields=none
/*
//

correct me if it is worng
Back to top
View user's profile Send private message
Direction

New User


Joined: 15 Sep 2005
Posts: 11

PostPosted: Mon Dec 26, 2005 7:38 pm    Post subject: Re: Fetch data Through input file with out duplication.
Reply with quote

Thanx for ur favour, But it not giving the desired result.
By using this JCL my output is :

123 123456
122 123457
121 123459

But the Answer I reqire is:

123 123456
122 123457
121 123461
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Dec 26, 2005 10:12 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for.

Code:

//S1   EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN  DD *
123 123456
122 123457
121 123459
121 123460
121 123461
/*
//OUT  DD SYSOUT=*
//TOOLIN   DD *
SELECT FROM(IN) TO(OUT) ON(1,3,CH) LAST USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,3,CH,D)
/*


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
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 Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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