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
 

 

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 Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm


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