I've now done a real test against the Danish streets. To do this, I first made the Streetcode 8,ZD, and the Housenumber 3,ZD - using your brilliant symbol file, that was a walk in the park..
Now, there's an issue with my collegues street, Anyvej (we do call it Anyway ).. There are some strange holes on this street. Here's the input:
The curious thing is that I'd expect there to be more items listed (if something is out with the definitions) rather than have something go missing.
So I made the full change to match your data, and got this (with my HEADING1):
Code:
STREET HOUSEFROM HOUSETO EVEN/ODD
00008548 009 013 O
00008548 002 016 E
00008548 020 028 E
This is the complete symbol file I used for that output:
Code:
* INPUT RECORD TO JNFNCNTL
INJ-STREET-REF,1,8,CH
SKIP,4
INJ-HOUSE-NO,*,3,ZD
POSITION,INJ-HOUSE-NO
SKIP,2
INJ-HOUSE-NO-LAST,*,1,ZD
* EXTENSION FROM JNFNCNTL
EXTJ-LAST-OF-NUMBER-BITS,*,8,CH
POSITION,EXTJ-LAST-OF-NUMBER-BITS
SKIP,7
EXTJ-LAST-BIT-OF-BITS,*,1,CH
* OUTPUT FROM JNFNCNTL
OUTJ-RECORD,1,19,CH
OUTJ-STREET-REF,1,8,CH
OUTJ-ODDEVEN-BIT,*,1,CH
OUTJ-NUMBER,*,3,CH
OUTJ-ODDEVEN-SEQ,*,7,CH
* REFORMAT RECORD
REF-F1-STREET,1,8,CH
REF-F1-ODDEVEN,*,1,CH
POSITION,REF-F1-STREET
REF-F1-STREET-ODDEVEN,=,9,CH
REF-F1-NUMBER,*,3,ZD
REF-F1-SEQUENCE,*,7,CH
REF-F2-STREET,*,8,CH
REF-F2-ODDEVEN,*,1,CH
POSITION,REF-F2-STREET
REF-F2-STREET-ODDEVEN,=,9,CH
REF-F2-NUMBER,*,3,ZD
REF-F2-SEQUENCE,*,7,CH
* EXTEND REFORMAT RECORD
REFEX-NUMBER-DIFF,*,5,CH
REFEX-START-NUMBER,*,3,CH
REFEX-SAVE-F2-NUMBER,*,3,CH
REFEX-SEQ,*,1,BI
REFEX-LEFT-DIFF,*,5,CH
I'll try some more testing as well, I think.
I'll also see if I can improve on the symbol definitions, there are several places needing lengths to be changed: it would be nice if there were just one :-)
If your symbols match the above, can you post the previous street to the one where you see the problem, please?
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
That data was the same as I had. I ran it anyway, and it produced the same results as I showed previously:
Code:
STREET HOUSEFROM HOUSETO EVEN/ODD
00008548 009 013 O
00008548 002 016 E
00008548 020 028 E
That "lrecl" is a nice thing. I can' do that, as I don't have DFSORT 2.1, which greatly extended the places where a symbol could be used. It adds one unnecessary byte, but a small price to pay in this type of situation.
I can't imagine how the IFOUTLEN would affect the results. I'll try a manual one anyway.
That "lrecl" is a nice thing. I can' do that, as I don't have DFSORT 2.1, which greatly extended the places where a symbol could be used. It adds one unnecessary byte, but a small price to pay in this type of situation.
Didn't see this post at first. Yes, I agree. A small price to pay. Would be fantastic if we could have calculations in symbols..
Bill, the last comma in your code makes me wonder where to put it exactly, because last group would be right before OUTFIL - thus the comma shouldn't be there?
In the mean time, I also worked a little more and got something working. I know it's not the best but I believe it's easier to debug and understand what is being done if you use multiple steps. I know Bill would not agree but that would be me doing it ;-)
1. Identify Even/Odd.
2. ICETOOL Step: Run this step 2 times using Even and Odd file separately. You'll get 2 output files (one from each run):
Could you please try this one as well with your different Inputs to see if it works? I am just curious to know whether the approach fetched me the right results
.
Your 2) is a long way round. You can just do a JOINKEYS with JNFnCNTL files. The SKIPREC gives the same effect as starting the sequence from 0/1 for the different files.
Then the point of you running it twice is for the odd and the even. So with the odd/even embedded in the file, it comes back to the JOINKEYS.
Everything in your 3) can be done in the Main Task of a JOINKEYS. So you have the two JNFnCNTLs, the two JOINKEYS, and the Main Task with SORT and OUTREC.
Not sure how that makes it more complicated :-)
Sure, I've had to change mine twice, but that's because I pickled it in the first place...
@Bill: When I first looked at your earlier posts, I thought it would be complicated and I would not be able to achieve it. But then, somehow, I got some courage to try more on that to get to the above post of mine.
You have already given the solution but since I had also put some efforts, I want Claes to say it is also working and make me feel happy about it :-)