I wrote the example to be simple but in actuality the data I will be working with won't be. I will be working with many different files. They will need to be sorted on more than one criteria. Some will need to be sorted by name, other by date, time, etc. And even in combinations.
I hope I explained that better, or would you like me to provide examples?
After talking to a coworker about this topic, what I want to be cant be done.
You can only have one sort field per sort card.
I will have to create a different sort card for each file and work with them separately.
So first I will filter my data into separate files, then sort each file individually.
1310078+INVALID ACCOUNT NUMBER
1310061+WRONG MERCHANT NUMBER
1310231+MISSING USER ID
So above is the input data that I would need moved into 4 files based on whats in the first 2 columns.
1A to REPORT1A, and so on with 11, 12, and 13. This is the easy part cuz I can accomplish that with INCLUDE command.
Now heres the tricky part... Sorting on different fields
I want REPORT1A to sort on field 15-18
REPORT11 on field 3-9, 17-20, and 24-30
REPORT12 on field 3-12,13-21
REPORT13 on field 3-7
Yes, you temporarily extend the records with INREC, to include enough bytes for the longest key. You put the key in the extension, depending on the type, using IFTHEN=(WHEN=(logical expression). Then you SORT on the extended key, and use four OUTFILs with three INCLUDE= for the different key, with BUILD to reduce the record to the original data, and a final OUTFIL with SAVE and the same BUILD.
Can you show me the code with the example I gave. Im just not getting how the fields are getting sorted. Under normal circumstances I could research this, however, I have to present this idea soon.
Like I said though, I'm not all the familiar with SORT, or JCL. Im really confused about the BUILD condition because I thought that was for formating. And I don't know the input or the output of the file being used in the example so I cant even make the connections.
This is what I have so far. I really don't understand the rest.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum