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
 
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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm

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