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
 

 

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: 144

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: 144

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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts DSNACCOX (can it be run on 1 db/ts, t... SRICOBSAS DB2 3 Sat May 06, 2017 12:59 am
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts Application not run by time HH:MM tri... jzhardy IBM Tools 1 Sun Apr 09, 2017 3:22 pm


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