Hi Frank,
I will explain you why i have complicated the solution. I dont know if the NAME field is in sorted order. So, when we consider an input like this
Code:
ZVJE1 ACC.DEATH
ZVJE1 HMS
ZVJE1 SUPP.
AMPE2 HMS
AMPE2 SUPP.
PXVE3 ACC.DEATH
PXVE3 DENTAL
PXVE3 HMS
Your SORT card gives an output like this:the names are sorted, but the sample o/p provided by lanand_hps retains the same order of i/p.
Code:
AMPE2 HMS
AMPE2 SUPP.
PXVE3 HMS
PXVE3 ACC.DEATH
PXVE3 DENTAL
ZVJE1 HMS
ZVJE1 ACC.DEATH
ZVJE1 SUPP.
Where as my SORT card retains the same order as i/p.This is how my o/p looks.
Code:
ZVJE1 HMS
ZVJE1 ACC.DEATH
ZVJE1 SUPP.
AMPE2 HMS
AMPE2 SUPP.
PXVE3 HMS
PXVE3 ACC.DEATH
PXVE3 DENTAL
lanand_hps: If it is OK to have the names in sorted order then you can use frank's simple solution, else the solution is as complicated as i have shown.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Hmmm ... not sure why you assumed the OP wanted something more complicated than the example showed without asking. I usually find its best to assume the simple solution will work or ask for clarification. If the simple solution doesn't work, the burden is on the OP to explain further.
Note that your output, like mine, assumes that the second field is to be sorted in order except that HMS is first. So for Name3 we both have Acc. Death followed by Dental even though the OP shows Dental followed by Acc. Death. I assumed the OP made a mistake there and I assume you did too. If you were going for the more complicated solution, maybe you shouldn't have assumed that either, or asked for the "rules" that could give that output.
Quote:
If it is OK to have the names in sorted order then you can use frank's simple solution, else the solution is as complicated as i have shown.
I'm not sure that's true. If the OP says the names have to be in their original order, then I'll take another look at it.
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
Anand,
Quote:
can you give me a one liner for each of the IFTHEN used for Frank's method? It'll be gr8..
I believe you wanted to know what exactly the ifthen statment does.
First it initializes every record with value '1' at 81 col without any cond verified. In the second ifthen, depending on the condition specified in WHEN clause, '0' is overwritten on '1'.
If you are looking for anything more, let us know.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
lanand_hps,
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from: