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

Joinkeys with no key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Tue Jan 13, 2015 3:00 pm
Reply with quote

Hi,

I have requirement to reformat the records as below. Both the input files are fixed length of 520.

Input file-1:


1111 RAMESH CHENNAI *#&##@ INDIA
2222 SURESH BANGALORE *$*%#*@ INDIA
3333 RAVI MUMBAI *%*%##2 INDIA
4444 AJAY KOLKATA ^&%*$(#@ INDIA


Input file-2:

VITE001 PGMR
VITE002 ASSIT
VITE002 MNGR
VITE003 PGMR

Output File:

1111 RAMESH CHENNAI PGMR INDIA
2222 SURESH BANGALORE ASSIT INDIA
3333 RAVI MUMBAI MNGR INDIA
4444 AJAY KOLKATA PGMR INDIA

I tried with below control card, it’s not working as expected. Please help me in this?

//SYSIN DD *
OPTION COPY
JOINKEYS FILE=F1,FIELDS=(520,1,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(520,1,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,32,F2:33,160,F1:193,428)
//*
//JNF1CNTL DD *
OPTION STOPAFT=45
INREC OVERLAY=(520:C'A')
//*
//JNF2CNTL DD *
OPTION STOPAFT=45
INREC OVERLAY=(520:C'A')
/*

Thanks in advance

Regards,
Rajesh S.
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Tue Jan 13, 2015 4:18 pm
Reply with quote

To make it more clear. Below is my requirement

Input file-1:

Code:
1111    RAMESH    CHENNAI        *#&##@        INDIA
2222    SURESH    BANGALORE      *$*%#*@       INDIA
3333    RAVI      MUMBAI         *%*%##2       INDIA
4444    AJAY      KOLKATA        ^&%*$(#@      INDIA


Input file-2:

Code:
VITE001 PGMR
VITE002 ASSIT
VITE002 MNGR
VITE003 PGMR


Output file:

Code:
1111    RAMESH    CHENNAI        PGMR       INDIA
2222    SURESH    BANGALORE      ASSIT      INDIA
3333    RAVI      MUMBAI         MNGR       INDIA
4444    AJAY      KOLKATA        PGMR       INDIA


I have tried with below control card. but it's not give desire output.

Code:

//SYSIN DD *
OPTION COPY
JOINKEYS FILE=F1,FIELDS=(520,1,A),SORTED,NOSEQCK
JOINKEYS FILE=F2,FIELDS=(520,1,A),SORTED,NOSEQCK
REFORMAT FIELDS=(F1:1,32,F2:33,160,F1:193,428)
//*
//JNF1CNTL DD *
OPTION STOPAFT=45
INREC OVERLAY=(520:C'A')
//*
//JNF2CNTL DD *
OPTION STOPAFT=45
INREC OVERLAY=(520:C'A')
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jan 13, 2015 5:36 pm
Reply with quote

If you create a key which only has one value on both files, you will get a Cartesian Join. Every record on both files will match every other.

You need to instead use a sequence number added to each record of both files, and use that as the key.

You can cut down the size/format of the data that you want with BUILD on INREC in the JNFnCNTL files, then order it with the REFORMAT statement.
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Wed Jan 14, 2015 11:10 am
Reply with quote

Thanks Bill,

It works as you said.

Code:

//SYSIN  DD *                                         
  OPTION COPY                                         
    JOINKEYS FILE=F1,FIELDS=(621,4,A),SORTED,NOSEQCK 
    JOINKEYS FILE=F2,FIELDS=(621,4,A),SORTED,NOSEQCK 
    REFORMAT FIELDS=(F2:1,32,F1:33,160,F2:193,428)   
//*                                                   
//JNF1CNTL DD *                                       
    OPTION STOPAFT=1000                               
    INREC OVERLAY=(621:SEQNUM,4,ZD)                   
//*                                                   
//JNF2CNTL DD *                                       
    OPTION STOPAFT=1000                               
    INREC OVERLAY=(621:SEQNUM,4,ZD)                   
/*                                                   
//                                                   
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Wed Jan 14, 2015 12:56 pm
Reply with quote

Hi,

I need to modify the control card to retain some of the record fields are in readable format from file-1. how can we do it?

Input File-1:

Code:
1111    RAMESH    CHENNAI        *#&##@        INDIA
2222    SURESH    BANGALORE      *$*%#*@       INDIA
3333    RAVI      MUMBAI         *%*%##2       INDIA
4444    HARI      NOIDA          PGMR2         INDIA
5555    AJAY      KOLKATA        ^&%*$(#@      INDIA
6666    KUMAR     PUNE           PGMR4         INDIA
7777    MAGESH    MANGALORE      MNGR2         INDIA


Input File-2:

Code:
VITE001 PGMR1
VITE002 ASSIT1
VITE003 MNGR1
VITE004 PGMR2
VITE005 PGMR3
VITE006 PGMR4
VITE007 MNGR2


Output File-3:

Code:
1111    RAMESH    CHENNAI        PGMR1      INDIA
2222    SURESH    BANGALORE      ASSIT1     INDIA
3333    RAVI      MUMBAI         MNGR1      INDIA
4444    HARI      NOIDA          PGMR2      INDIA
5555    AJAY      KOLKATA        PGMR3      INDIA
6666    KUMAR     PUNE           PGMR4      INDIA
7777    MAGESH    MAGALORE       MNGR2      INDIA
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jan 14, 2015 6:03 pm
Reply with quote

You'll have to be more explicit about what you mean. I can read all of your sample output, so what is the problem?
Back to top
View user's profile Send private message
Rajesh S
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 54
Location: Chennai

PostPosted: Wed Jan 14, 2015 10:59 pm
Reply with quote

Sorry Bill,
I have modify the input files as below. First field in both file are same. I want to retain the records 'ZZT' which are readable format.

Input file-1

Code:
ZZA 1111    RAMESH    CHENNAI        *#&##@        INDIA
ZZA 2222    SURESH    BANGALORE      *$*%#*@       INDIA
ZZB 3333    RAVI      MUMBAI         *%*%##2       INDIA
ZZT 4444    HARI      NOIDA          PGMR2         INDIA
ZZB 5555    AJAY      KOLKATA        ^&%*$(#@      INDIA
ZZT 6666    KUMAR     PUNE           PGMR4         INDIA
ZZT 7777    MAGESH    MANGALORE      MNGR2         INDIA


Input file -2:

Code:
ZZA VITE001 PGMR1
ZZA VITE002 ASSIT1
ZZB VITE003 MNGR1
ZZT VITE004 *&%'#@
ZZB VITE005 PGMR3
ZZT VITE006 *&%$?%
ZZT VITE007 *#@!&?
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 Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Sort with JOINKEYS using two VB files DFSORT/ICETOOL 1
No new posts JOINKEYS, how to keep all occurrences? DFSORT/ICETOOL 2
Search our Forums:

Back to Top