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
 
compare time columns using DFSORT

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

Active User


Joined: 05 Oct 2006
Posts: 147

PostPosted: Fri Sep 09, 2011 12:00 pm    Post subject: compare time columns using DFSORT
Reply with quote

Hi,

I Have two files(record lenght of both the file is 16, and key is 1-10)


file 1 is as below.

FILE!:
Date(1-8)depot(9-10) Time(11-16)
20110905 D1 130024
20110905 D2 140018
20110905 D3 140026
20110905 D4 150001

for each key of file 1 there will be a multiple entry in the file 2(with the different time).

Date(1-8)depot(9-10) Time(11-16)
20110905 D1 120014
20110905 D1 120088
20110905 D1 130061
20110905 D1 130091
20110905 D2 130018
20110905 D2 140077
20110905 D2 140093
20110905 D3 140020
20110905 D3 140023
20110905 D3 140081
20110905 D4 140088
20110905 D4 150011
20110905 D4 150083
20110905 D4 150088

i want to fetch only those records from file2 which has time in (position 11-16) greater than time(1-16) in File1 .

so my output file should be as below.

File3:
Date(1-8)depot(9-10) Time(11-16)
20110905 D1 130061
20110905 D1 130091
20110905 D2 140077
20110905 D2 140093
20110905 D3 140081
20110905 D4 150011
20110905 D4 150083
20110905 D4 150088

can this be achieved using dfsort?.

regds,
useit
Back to top
View user's profile Send private message

kratos86

Active User


Joined: 17 Mar 2008
Posts: 148
Location: Anna NGR

PostPosted: Fri Sep 09, 2011 12:21 pm    Post subject:
Reply with quote

Hello,

Yes it can be achieved. Try this
Code:
//S1 EXEC PGM=SORT                           
//SYSOUT DD SYSOUT=*                         
//SORTJNF2 DD *                             
20110905D1130024                             
20110905D2140018                             
20110905D3140026                             
20110905D4150001                             
//SORTJNF1 DD *                             
20110905D1120014                             
20110905D1120088                             
20110905D1130061                             
20110905D1130091                             
20110905D2130018                             
20110905D2140077                             
20110905D2140093                             
20110905D3140020                             
20110905D3140023                             
20110905D3140081                             
20110905D4140088                             
20110905D4150011                             
20110905D4150083                             
20110905D4150088                             
//SORTOUT DD SYSOUT=*                       
//SYSIN DD *                                 
  JOINKEYS FILE=F1,FIELDS=(1,10,A)           
  JOINKEYS FILE=F2,FIELDS=(1,10,A)           
  REFORMAT FIELDS=(F1:1,17,F2:1,17)         
  SORT FIELDS=COPY                           
  INCLUDE COND=(11,6,ZD,GT,28,6,ZD)         
  OUTREC BUILD=(1,17)                       
/*                                           


output -
Code:
20110905D1130061
20110905D1130091
20110905D2140077
20110905D2140093
20110905D3140081
20110905D4150011
20110905D4150083
20110905D4150088
Back to top
View user's profile Send private message
useit

Active User


Joined: 05 Oct 2006
Posts: 147

PostPosted: Fri Sep 09, 2011 12:49 pm    Post subject:
Reply with quote

it is working and thanks a lot for your help:)

Regds,
useit
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 Formatting using DFsort Guru Nandu DFSORT/ICETOOL 5 Thu Nov 30, 2017 7:33 am
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Can EDCICONV convert EBCDIC to ASCII... natt.sut IBM Tools 3 Fri Nov 17, 2017 8:46 pm
No new posts Compare and COPY using DFSORT pshongal DFSORT/ICETOOL 3 Fri Nov 17, 2017 9:49 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm

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