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

Joining two files record by record.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Fri Apr 05, 2013 8:39 am
Reply with quote

Hi,

I am doing a join of two FB 80 Files record by record.

Sample File 1
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
SY#OPCNAME1     -JOBNAME1|A|E|W1#STARTOFBATCH -JSDMYD1A
SY#OPCNAME1     -JOBNAME2|A|I|SY#OPCNAME1     -JOBNAME1


Sample File 2
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
SY#OPCNAME1     -TSYS_005|A|E|W1#STARTOFBATCH -TSYS_201
SY#OPCNAME1     -TSYS_010|A|I|SY#OPCNAME1     -TSYS_005


Output Required as FB 80 file as follows

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
SY#OPCNAME1     -TSYS_005-JOBNAME1|A|E|W1#STARTOFBATCH -TSYS_201-JSDMYD1A
SY#OPCNAME1     -TSYS_010-JOBNAME2|A|I|SY#OPCNAME1     -TSYS_005-JOBNAME1


I used the following sort Job
Code:
//SYSIN DD *                                               
  JOINKEYS F1=INA,FIELDS=(56,8,A),SORTED,NOSEQCK           
  JOINKEYS F2=INB,FIELDS=(56,8,A),SORTED,NOSEQCK           
  REFORMAT FIELDS=(F1:1,17,F2:18,8,F1:18,8,F1:26,22,F2:48,8,
                   F1:48,8)                                 
  OUTFIL FNAMES=OUT,BUILD=(1,71,9X)                         
  OPTION COPY                                               
/*                                                         
//JNF1CNTL DD *                                             
  INREC OVERLAY=(56:SEQNUM,8,BI)                           
/*                                                         
//JNF2CNTL DD *                                             
  INREC OVERLAY=(56:SEQNUM,8,BI)                           
/*                                                         

Got the output as below

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
SY#OPCNAME1     -TSYS_005JOBNAME1|A|E|W1#STARTOFBATCH -TSYS_201JSDMYD1A
SY#OPCNAME1     -TSYS_010JOBNAME2|A|I|SY#OPCNAME1     -TSYS_005JOBNAME1


I wanted to insert a '-' (hyphen) in the 27th and 65th Position to get my desired output.

So I used the following sort card to build the OUTFIL accordingly.

Code:
//SYSIN DD *                                               
  JOINKEYS F1=INA,FIELDS=(56,8,A),SORTED,NOSEQCK           
  JOINKEYS F2=INB,FIELDS=(56,8,A),SORTED,NOSEQCK           
  REFORMAT FIELDS=(F1:1,17,F2:18,8,F1:18,8,F1:26,22,F2:48,8,
                   F1:48,8)                                 
  OUTFIL FNAMES=OUT,BUILD=(1,26,C'-',28,37,C'-',66,8,7X)   
  OPTION COPY                                               
/*                                                         
//JNF1CNTL DD *                                             
  INREC OVERLAY=(56:SEQNUM,8,BI)                           
/*                                                         
//JNF2CNTL DD *                                             
  INREC OVERLAY=(56:SEQNUM,8,BI)                           
/*   


But got the following error message. Someone please help me

Code:
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2                 
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR INA      - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR INB      - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=F, LENGTH=71                                     
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1                         
ICE027A 9 END OF OUT      FIELD BEYOND MAXIMUM RECORD LENGTH                   
ICE751I 0 C5-K76982 C6-K90026 C7-K58148 C8-K67572 E9-K60824 E7-K70685           
ICE052I 3 END OF DFSORT   
Back to top
View user's profile Send private message
Bharath RajaramSridharan

New User


Joined: 10 Dec 2012
Posts: 20
Location: Australia

PostPosted: Fri Apr 05, 2013 9:32 am
Reply with quote

Hi Everyone,

Spent some time debugging the positions in the file and used the following sort card. It worked!! icon_smile.gif

Code:
//SYSIN DD *                                             
  JOINKEYS F1=INA,FIELDS=(81,8,A),SORTED,NOSEQCK           
  JOINKEYS F2=INB,FIELDS=(81,8,A),SORTED,NOSEQCK           
  REFORMAT FIELDS=(F1:1,17,F2:18,8,F1:18,8,F1:26,22,F2:48,8,
                   F1:48,8,F1:56,25)                       
  OUTFIL FNAMES=OUT,BUILD=(1,25,C'-',26,38,C'-',64,8,7X)   
  OPTION COPY                                               
/*                                                         
//JNF1CNTL DD *                                             
  INREC OVERLAY=(81:SEQNUM,8,BI)                           
/*                                                         
//JNF2CNTL DD *                                             
  INREC OVERLAY=(81:SEQNUM,8,BI)                           
/*                                                         
icon_smile.gif icon_smile.gif icon_smile.gif
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: Fri Apr 05, 2013 11:45 am
Reply with quote

Good work, and thanks for letting us know. I amalgamated you final two posts.
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: Fri Apr 05, 2013 12:18 pm
Reply with quote

Looking at your Control Cards now, there are three "tasks" for a JOINKEYS operation, one for each of the input files and the "main task". In the main task you can have, effectively, full additional processing of the joined file.

This means your requirement could be served by INREC, or OUTREC as well as OUTFIL.

You are "padding" to 80 bytes by, in you first example 9X, then 7X after the two "-" are inserted.

More reliably, as you don't need to count and change it, you could do that with 80:X, which puts a space in column 80, and pads from the previous end of record to that point, if padding is necessary.

You're now right up close to the line numbers....
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top