I had 2 input files in which i need to compare to one of the field which is a packed decimal in both the files
and if it matches then i need to extract those records in one separate file and then I need to extract the unmatched
records of file1 in one file and unmatched records of file2 separately in another file.
I tried tried this with Joinkeys but I dont know to extract the whole records, i first converted the PD to ZD
format of only the required field and extrated, but i need the whole record. Please help and expalin how to
deal with the packed decimals.
My Input file1:
starting postion -- 2 and length is 4 (so with hex on, in PD condition length is 8 including signed digit)
file1
========
Code:
1.hÂ<.....FRAUD0488624 POTENTIA
1.hÂ*.....FRAUD0488625 POTENTIA
1.hÂ%.....FRAUD0488626 POTENTIA
1.hÂð.....FRAUD0488628 POTENTIA
1 êcð A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êcæ A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êc 'ABU JIBRIL' MICHAEL
F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
1 êc 'ABU JIBRIL' MICHAEL
F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
-------------------------------------------------------------------------
file2
========
Code:
1 êcð A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êcæ A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êd A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êd A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL JALAN BIMA BLOK C NO 1
1 êd ABDALLAH KATHRIN
with hex on
1 êc 'ABU JIBRIL' MICHAEL
F0582000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
1 êc 'ABU JIBRIL' MICHAEL
F0583000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
1 êc< 'ABU JIBRIL' MICHAEL
F0584000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
1 êc* 'ABU JIBRIL' MICHAEL
F0585000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
------------------------------------------------------------------------
1 êc% 'ABU JIBRIL' MICHAEL JALAN BIMA BLOK C NO 1
F0586000007CCE4DCCDCD74444444444444DCCCCCD44444444DCDCD4CCDC4CDDD4C4DD4F
1923C0000CD1240192993D00000000000004938153000000001131502941023620305601
Comparing is like from file1 after zd conversion(position 2-5) is 0952832 = 0488629 and so on..
Code:
Output file1:
------------
1 êcð A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êcæ A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
Output file3:
------------
1 êd A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL
1 êd A RAHMAN MOHAMAD IQBAL MICHAEL DEPAUL JALAN BIMA BLOK C NO 1
1 êd ABDALLAH KATHRIN
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
Note how, since you did not use the "code" tag, your hex display does not line up vertically, making it a nuisance, at best, for others (and you) to see which hex value lines up with each display character.
1 êc< 'ABU JIBRIL' MICHAEL
F0584000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc* 'ABU JIBRIL' MICHAEL
F0585000007CCE4DCCDCD74444444444444DCCCCCD444444444444444444444444444444
1923C0000CD1240192993D00000000000004938153000000000000000000000000000000
1 êc% 'ABU JIBRIL' MICHAEL JALAN BIMA BLOK C NO 1
F0586000007CCE4DCCDCD74444444444444DCCCCCD44444444DCDCD4CCDC4CDDD4C4DD4F
1923C0000CD1240192993D00000000000004938153000000001131502941023620305601
My file record length is 1000 FB.
input1 and input2 files are production files hence it is not possible for me convert or change file
the format.I have shown my input file format earlier in the post, for better understanding i showed the file with
HEX ON, but those cannot be done in production. Also i tried ur code but still i received an error message as
Code:
SYSIN :
JOINKEYS FILES=F1,FIELDS=(2,4,A)
JOINKEYS FILES=F2,FIELDS=(2,4,A)
JOIN UNPAIRED
REFORMAT FIELDS=(F1:1,1000,?,F2:1,1000)
*
OPTION COPY
OUTFIL FNAMES=UN1,INCLUDE=(1001,1,CH,EQ,C'1'),BUILD=(1,1000)
OUTFIL FNAMES=UN2,INCLUDE=(1001,1,CH,EQ,C'2'),BUILD=(1002,1000)
OUTFIL FNAMES=OUT,INCLUDE=(1001,1,CH,EQ,C'B'),BUILD=(1,1000)
WER268A REFORMAT STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
Could please suggest me how to get the exact output in the same format which i had mentioned earlier without
affecting the input file.
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
Hi Senthilkumar k,
Quote:
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
As per the above statement the sort product called by your shop is SYNCSORT not DFSORT. I have not worked in SYNCSORT. The above code is working fine in DFSORT without any issues.
Hope someone will help in giving the solution in SYNCSORT. From next time please try to post your query in correct forum.