I need to join the record between these two files.
Since File2 is packed decmial and sorted in a different order, I built the File1 as File2 using following Sort
you could see I took 4,7 and Left 11th byte and the 12,6 and added to make or to match with input file 2
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 1:30 pm Post subject:
Magesh_J,
In Joinkeys operation, the matching keys will be treated as binary, so they must be "normalized". For example, if the keys are actually zoned decimal, they must have all C and D signs, or all F and D signs. You can use an INREC statement in JNF1CNTL and/or JNF2CNTL to normalize the keys for the F1 file and/or F2 file, respectively, if appropriate.
I am not sure as to why you need to add C'0101010100' for file 1 to match.
Please answer the following questions.
1. What is the cobol layout definitions of input file 1?
Your keys in input file 1 are :
Code:
CCCCCCC 123456
CCCCCCC 123457
Character data is clear but now you need to take the 6 bytes zoned decimal number(123456) and match it with 8 packed decimal number but only the leading 3 bytes(byte 9 thru 11) of input file2 which is in packed decimal format?
1. What is the cobol layout definitions of input file 1?
X(17) + Filler + X(1)
Kolusu wrote:
Character data is clear but now you need to take the 6 bytes zoned decimal number(123456) and match it with 8 packed decimal number but only the leading 3 bytes(byte 9 thru 11) of input file2 which is in packed decimal format?
In input file2
First field is X(7)
second fields is S9(17) comp-3
In that this value is 123456101010100 stored.
I mean in the s9(17), last ten digit we have to exclude and consider rest of the value.
Code:
second input file.
7/AN 9/PS
(1-7) (8-16)
2---------- 3------------------
*******************************
CCCCCCC 1234562102260100 => It should not match, Copy to output
CCCCCCC 1234562102260200 => It should not match,Copy to output
CCCCCCC 1234562102400100 => It should not match,Copy to output
CCCCCCC 1234562201010100 => It should not match,Copy to output
CCCCCCC 1234562201200100 => It should not match,Copy to output
CCCCCCC 1234562201400100 => It should not match,Copy to output
CCCCCCC 1234560101010100 => It should match, for this matching record we have to change 59th position if 3 then 6, If 5 then 8 and If 6 then 9 and copy to output.
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 3:10 pm Post subject:
Magesh_J,
If your intention is to get both matched and unmatched records from File, then you just need JOIN UNPAIRED,F1. Remove the ONLY as it gets only the unmatched records.
Anyway here is a Job which will give you the desired results.
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//VB254 DD DISP=SHR,DSN=Your Input VB 254 byte file
//FB018 DD DISP=SHR,DSN=Your Input FB 018 byte file
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
JOINKEYS F1=VB254,FIELDS=(5,16,A)
JOINKEYS F2=FB018,FIELDS=(1,16,A)
REFORMAT FIELDS=(F1:1,4,?,F1:63,1,5)
JOIN UNPAIRED,F1
INREC BUILD=(01,04, $ RDW
07,58, $ DATA TILL CHANGE
63:05,02,CHANGE=(1,C'B3',C'6', $ FLAG "3" TO "6"
C'B5',C'8', $ FLAG "5" TO "8"
C'B6',C'9'), $ FLAG "6" TO "9"
NOMATCH=(65,1), $ FLAG AS IS
66) $ REST OF DATA
//*
//JNF2CNTL DD *
INREC IFTHEN=(WHEN=INIT,BUILD=(4,7,12,6,C'0101010100')),
IFTHEN=(WHEN=INIT,OVERLAY=(8:8,16,ZD,PD,LENGTH=9))
//*
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
ICE218A 3 55 BYTE VARIABLE RECORD IS SHORTER THAN 65 BYTE MINIMUM FOR
ICE751I 1 EF-K49535 F0-K66716 E8-K61438
ICE052I 0 END OF DFSORT
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 3:46 pm Post subject:
Magesh_J,
Looks like you have short records. Use the following control cards. I also optimized the JNF2 a little bit.
Code:
//SYSIN DD *
OPTION COPY
JOINKEYS F1=VB254,FIELDS=(5,16,A)
JOINKEYS F2=FB018,FIELDS=(1,16,A)
REFORMAT FIELDS=(F1:1,4,?,F1:63,1,5)
JOIN UNPAIRED,F1
INREC IFTHEN=(WHEN=(1,2,BI,GE,65),
BUILD=(01,04, $ RDW
07,58, $ DATA TILL CHANGE
63:05,02,CHANGE=(1,C'B3',C'6', $ FLAG "3" TO "6"
C'B5',C'8', $ FLAG "5" TO "8"
C'B6',C'9'), $ FLAG "6" TO "9"
NOMATCH=(65,1), $ FLAG AS IS
66)), $ REST OF DATA
IFTHEN=(WHEN=NONE,BUILD=(1,4,7)) $ SHORT RECORDS
//*
//JNF1CNTL DD *
OPTION VLSHRT,DYNALLOC=(,32)
//*
//JNF2CNTL DD *
INREC IFOUTLEN=16,
IFTHEN=(WHEN=INIT,BUILD=(4,7,12,6,C'0101010100')),
IFTHEN=(WHEN=INIT,OVERLAY=(8:8,16,ZD,PD,LENGTH=9))
//*
********************************* TOP OF DATA **********************************
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 12:49 ON WED NO
OPTION COPY
JOINKEYS FILE=F1,FIELDS=(5,16,A)
JOINKEYS FILE=F2,FIELDS=(1,16,A)
REFORMAT FIELDS=(F1:1,4,?,F1:63,1,5)
JOIN UNPAIRED,F1
INREC BUILD=(01,04,
07,58,
63:05,02,CHANGE=(1,C'B3',C'6',
C'B5',C'8',
C'B6',C'9'),
NOMATCH=(65,1),
66)
ICE411I 0 THIS IS THE JOINKEYS MAIN TASK FOR JOINING F1 AND F2
ICE416I 0 JOINKEYS IS USING THE F1 SUBTASK FOR SORTJNF1 - SEE JNF1JMSG MESSAGES
ICE416I 1 JOINKEYS IS USING THE F2 SUBTASK FOR SORTJNF2 - SEE JNF2JMSG MESSAGES
ICE419I 0 JOINED RECORDS: TYPE=V, LENGTH=256
ICE201I H RECORD TYPE IS V - DATA STARTS IN POSITION 5
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 E9-K60823 C9-BASE E5-K62201
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE089I 0 JOINKEYS.S1 . , INPUT LRECL = 256, TYPE = V
ICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=2097152,MINLIM=450560,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=8192,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
ICE218A 3 55 BYTE VARIABLE RECORD IS SHORTER THAN 65 BYTE MINIMUM FOR F
ICE751I 1 EF-K49535 F0-K66716 E8-K61438
ICE052I 0 END OF DFSORT
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 4:18 pm Post subject:
Magesh_J wrote:
Please find the below messages for the same job
Magesh_J,
I am missing something here. My response to your Initial ICE218A message was to use INREC IFTHEN on the main task. I haven't yet seen you using that control cards. You are showing me the Subtask JNF1 and JNF2 messages.
Did you copy these control cards as is shown here?
Really sorry for the inconvenience,
it is working great and I missed it and Thank you very much
But a challenge we have, Job I submitted is a sample input file.
Original input file is 400 million records, will the workspace would be challenge (VB/254) file
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 4:40 pm Post subject:
Magesh_J wrote:
Dear Kolusu,
Really sorry for the inconvenience,
it is working great and I missed it and Thank you very much
Glad you got it working.
Magesh_J wrote:
But a challenge we have, Job I submitted is a sample input file.
Original input file is 400 million records, will the workspace would be challenge (VB/254) file
Well you can specify Dyanlloc for a max of 255 sortwork datasets. So change JNF1CNTL to have 125 and then keep increasing it if you run into an error.
Code:
//JNF1CNTL DD *
OPTION VLSHRT,DYNALLOC=(,125)
Btw do you really need to match on the first 7 bytes of character data? Is it always a constant "CCCCCCC" or does it vary? If it is constant then we pretty much can eliminate it from the match key.
1. CCCCCCC is not standard it varies.
2. code is running without OPTION VLSHRT, do we really need to include this.
3. Is there anyway we can get a summary report of these changes in a separate file.
Example
Code:
Key value old new
CCCCCCC 1234560101010100 5 8
CCCCCCC 1234570101010100 6 9
Joined: 26 Nov 2002 Posts: 12369 Topics: 75 Location: San Jose
Posted: Wed Nov 05, 2014 5:16 pm Post subject:
Magesh_J wrote:
Kolusu,
1. CCCCCCC is not standard it varies.
2. code is running without OPTION VLSHRT, do we really need to include this.
Magesh_J,
I usually test it for all kinds of error situations and I had short records. I just added it to pad the short records. If you think your Input VB file will ALWAYS have at least 16 bytes then you don't need VLSHRT.
Magesh_J wrote:
3. Is there anyway we can get a summary report of these changes in a separate file.
Example
Code:
Key value old new
CCCCCCC 1234560101010100 5 8
CCCCCCC 1234570101010100 6 9
Yes it is quite simple. You just need to move the INREC to OUTFIL as you need separate files. Use the following control cards which will give you the desired results.
OUTFIL IFTHEN=(WHEN=(1,2,BI,GE,65),
BUILD=(01,04, $ RDW
07,58, $ DATA TILL CHANGE
63:05,02,CHANGE=(1,C'B3',C'6', $ FLAG "3" TO "6"
C'B5',C'8', $ FLAG "5" TO "8"
C'B6',C'9'), $ FLAG "6" TO "9"
NOMATCH=(65,1), $ FLAG AS IS
66)), $ REST OF DATA
IFTHEN=(WHEN=NONE,BUILD=(1,4,7)) $ SHORT RECORDS
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum