IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Merging the files and re-arranging the records using DF Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Tue Jun 19, 2007 7:29 pm
Reply with quote

I have two files, one with the actual dates(File1) and the other with the spaces(File2) into the date fields. After merging the output should be as specified below.

File1:
Client1 date1 date2
Client1 date1 date2
Client1 date1 date2
Client2 date1 date2
Client2 date1 date2
Client2 date1 date2
File2:
Client1
Client1
Client2
Client2

File3:
Client1 date1 date2
Client1 date1 date2
Client1 date1 date2
Client1
Client1
Client2 date1 date2
Client2 date1 date2
Client2 date1 date2
Client2
Client2

Could some body help me out please.
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Jun 19, 2007 7:39 pm
Reply with quote

srini_igsi

assuming that 1 through 7 characters is ClientN, try this sort card
Code:
merge fields=(1,7,ch,a)
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Tue Jun 19, 2007 8:46 pm
Reply with quote

Reddy,

Here's a DFSORT job that will do what you asked for. I assumed the two input files have compatible RECFMs and LRECLs. You need EQUALS to ensure that the order of duplicate records in SORTIN01 and SORTIN02 is maintained.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN01 DD DSN=... input file1
//SORTIN02 DD DSN=... input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION EQUALS
  MERGE FIELDS=(1,7,CH,A)
/*
Back to top
View user's profile Send private message
srini_igsi
Currently Banned

New User


Joined: 09 Dec 2005
Posts: 30
Location: Pune

PostPosted: Wed Jun 20, 2007 11:20 am
Reply with quote

Thank you very much Frank, it's working.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top