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
 

 

Sorting of two files

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

New User


Joined: 22 Nov 2005
Posts: 23

PostPosted: Mon Apr 25, 2011 8:44 pm    Post subject: Sorting of two files
Reply with quote

Hi,

I have two files. The content of the first file is as below.

Name Emp ID Dept

Tim 13333 Sales
John 14222 Marketing
Kim 12784 Administration
Johny 11344 Authorisation
Lilly 19345 Sales
Mary 78934 Finance

The second file has the Dept only

Dept

Authorisation
Finance
Sales

Only records which have department present in the second file needs to be written in the output file.

Output file

Name Emp ID Dept

Tim 13333 Sales
Johny 11344 Authorisation
Lilly 19345 Sales
Mary 78934 Finance

Please let me know if this could be done using DFSORT/ICETOOL.

Regards,
Nimi
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Apr 25, 2011 8:58 pm    Post subject:
Reply with quote

It seems like after 6 years you would know to provide the LRECL and format for the files and the field positions and lengths for the fields.
Back to top
View user's profile Send private message
nimisanand

New User


Joined: 22 Nov 2005
Posts: 23

PostPosted: Mon Apr 25, 2011 9:19 pm    Post subject:
Reply with quote

Both files are FB format with both having LREC 80.

Record layout for the first file

Name X(20)
Emp-ID 9(10)
Department X(30)


Second file Layout
X(30)
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 Apr 25, 2011 10:33 pm    Post subject:
Reply with quote

You can use a DFSORT JOINKEYS job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//IN1 DD *
Tim                      13333Sales
John                     14222Marketing
Kim                      12784Administration
Johny                    11344Authorisation
Lilly                    19345Sales
Mary                     78934Finance
/*
//IN2 DD *
Dept
Authorisation
Finance
Sales
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  JOINKEYS F1=IN1,FIELDS=(31,30,A)
  JOINKEYS F2=IN2,FIELDS=(1,30,A)
  REFORMAT FIELDS=(F1:1,88)
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*
//JNF1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
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 Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am


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