|
View previous topic :: View next topic
|
| Author |
Message |
Bharath RajaramSridharan
New User
Joined: 10 Dec 2012 Posts: 20 Location: Australia
|
|
|
|
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 |
|
 |
Bharath RajaramSridharan
New User
Joined: 10 Dec 2012 Posts: 20 Location: Australia
|
|
|
|
Hi Everyone,
Spent some time debugging the positions in the file and used the following sort card. It worked!!
| 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)
/*
|
 |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
| Good work, and thanks for letting us know. I amalgamated you final two posts. |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|