View previous topic :: View next topic
|
Author |
Message |
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
Frank,
We are processing a delimited input file, and we wish to use DFSORT's INREC PARSE function to format the records (via BUILD). There are several "record types" present in the file; the record type is always identified at a fixed position in the record. We know we can use IFTHEN PARSE to test the identifier, and then parse the fields into % variables, based upon the expected fields for each record type.
Our problem is overcoming the limit of 100 parsed variables, in conjunction with the restriction against reusing any particular variable. No input record, regardless of its type, will have anywhere near 100 fields. But if we multiply the number of record types by the number of fields in each record, we exceed 100. We had thought that we could reuse the % variables in multiple IFTHEN PARSE clauses, but that produced this error on the second occurrence of %01:
ICE244A F DUPLICATE PARSED FIELD DEFINITION
Is there a recommended approach in a situation like this? If it will be helpful, we will post a specific example, but perhaps this generic description will be enough for you to guide us (or point us to an example).
Thanks,
David |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
David,
It's true that you can use up to 100 parsed variables in one pass. So you may have to use multiple passes (e.g. use multiple COPY operators in ICETOOL).
There may be another way, but it's difficult to tell based on the generic description. So please do post a specific example of input records and expected output records, along with the rules for getting from input to output. |
|
Back to top |
|
|
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
>It's true that you can use up to 100 parsed variables in one pass.<
I see... I think I misinterpreted the documentation ("Each %nn parsed field (%00-%99) can only be defined once per run with PARSE...") I took the word "run" to mean that the parsed variables could not be reused within a single execution of ICETOOL.
But if I understand correctly, we can reuse the variables in different ICETOOL operators within the same ICETOOL execution. I.e., we could have multiple COPY operators and use IFTHEN to parse only a subset of the record types in each COPY. As long as we don't exceed 100 variables in each operator, DFSORT will be happy, and we can MOD the parsed output records together into a single output dataset. Generally speaking, does that concept work?
David |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
But if I understand correctly, we can reuse the variables in different ICETOOL operators within the same ICETOOL execution. I.e., we could have multiple COPY operators and use IFTHEN to parse only a subset of the record types in each COPY. As long as we don't exceed 100 variables in each operator, DFSORT will be happy, and we can MOD the parsed output records together into a single output dataset. Generally speaking, does that concept work? |
Yes, that's correct. You can use up to 100 %nn variables for each operator. |
|
Back to top |
|
|
David Eisenberg
New User
Joined: 15 Nov 2007 Posts: 39 Location: New York
|
|
|
|
Great, Frank. Thanks for the info.
Have a great holiday weekend,
David |
|
Back to top |
|
|
|