Merging and Sorting segmented, delimited files

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
acavarra
Premium Member
Premium Member
Posts: 10
Joined: Wed Sep 16, 2009 10:12 am

Merging and Sorting segmented, delimited files

Post by acavarra »

I have numerous segmented files that share a common key but beyond that are defined differently.

How can I merge these files and sort on the common key in the process.

Any help would be greatly appreciated.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Can you post some examples of the actual file contents and then what this merged and sorted output should look like for the sample data? I think that would go a long way towards helping us help you properly.
-craig

"You can never have too many knives" -- Logan Nine Fingers
acavarra
Premium Member
Premium Member
Posts: 10
Joined: Wed Sep 16, 2009 10:12 am

Post by acavarra »

Do you want to see layout examples or actual data?
acavarra
Premium Member
Premium Member
Posts: 10
Joined: Wed Sep 16, 2009 10:12 am

Post by acavarra »

Let me know if you need more...

I have multiple files that contain a different set of data for claims processing. The files are:

Claims
Pharmacy
Prescriber
Patient
Insurance
etc...

The first 86 characters are the key they have in common...

Client, Group, Plan, Patient, Health Service ID, Health Service Item No, Record ID

followed by various columns of random data that pertain to that segment.

I need to sort all these files together by this key. The columns/data will not be modified at all. Im having problems because the files do not contain the same metadata.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

OK, that helps somewhat. So, what is the ultimate goal here? The creation of a single file with all of this combined, sorted by the common key and all of the variable record metadata (and record lengths) preserved?

Key1
Claims data for Key1
Pharmacy data for Key1
Prescriber data for Key1
Patient data for Key1
Insurance data for Key1
etc...
Key2
Claims data for Key2
Pharmacy data for Key2
Prescriber data for Key2
Patient data for Key2
Insurance data for Key2
etc...

:?:
-craig

"You can never have too many knives" -- Logan Nine Fingers
acavarra
Premium Member
Premium Member
Posts: 10
Joined: Wed Sep 16, 2009 10:12 am

Post by acavarra »

Exactly...for this pass!

Ultimately, I will be creating headers/footers using the key data to break on.
Post Reply