Brian Westerman wrote: >They have a flat file which has fields that can occur multiple times within a record, and there are multiple of those fields in the same record. They want to be able to use DFSORT to overlay (some of) those fields with specific data, but the offsets change based on how many occurrences of the recurring fields there are in each record.
Reminds me of SMF type 30. ;-) Assembler would be great, but you wanted DFSORT. >Is there a way to do this with the sort parm logic? >2abcdef1ab3abc What you can do is: 1. examine record for field1o and move field1o in one output dataset and REST of record to SECOND dataset. 2. Process field1o as usual. 3. Process the SECOND dataset for field2o and move REST of data not part of field2o to a THIRD dataset. 4. repeat for field3o in THIRD dataset, etc. Clumsy, I know, but you have several output files for each field?o where you can process each of them at your hearts leisure. >I know that we can multiply with the sort logic, ... With above way of processing, you probably don't need to struggle with offsets... >My problem is that I don't know that actual offset until execution time via the math, but I don't know of a way to hold that interim number so that I can use it in the next calculation (the one for field2o) and then the next one after that for field3o. DFSORT have variables handling for temporary data and interim numbers. >Is there a way to do that, if so, what would an example look like? Perhaps the DFSORT team can come up with a good example? >thanks for any help you can give, this one is driving me nuts, Perhaps REXX would be useful here. I can perhaps conjure up such a program, but then I will also be driven nuts too... Trust me... ;-D Groete / Greetings Elardus Engelbrecht ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html

