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
 

 

Joining two files record by record.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Joining two files record by record.
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    Post subject: Joining two files record by record.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Apr 05, 2013 11:45 am    Post subject: Reply to: Joining two files record by record.
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Apr 05, 2013 12:18 pm    Post subject: Reply to: Joining two files record by record.
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    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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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