View previous topic :: View next topic
|
Author |
Message |
David Sde
New User
Joined: 24 Apr 2011 Posts: 23 Location: USA
|
|
|
|
I have precisely the same need as the OP in this post (albeit with a different input file format).
Is Dick's reply above still true? I.e., have any of the new features since 2007 made it simpler to suppress repetitive data fields via the DISPLAY operator? Or are sequence numbers still the only way to go?
I know I can use the BREAK parameter on DISPLAY, but if I understand correctly, that will force a new page on each control field break. It would be much better to just suppress the printing of the data if it's identical to that of the line above (as is perfectly described in the OP's example above).
Any help would be appreciated; thank you!
David
URL'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The best is to ask a new question with a link to this one.
Can you post the control cards you have for now, and a sample of your input, and wha you want the output to look like? |
|
Back to top |
|
|
David Sde
New User
Joined: 24 Apr 2011 Posts: 23 Location: USA
|
|
|
|
>Can you post the control cards you have for now, and a sample of your input, and wha you want the output to look like?<
Bill,
I'm truthfully not being coy... the details in my case aren't any more interesting than those in the original thread. My column numbers and lengths differ, of course, but my issue is precisely the same. We're running DFSORT release 1.13. If I had posted the OPs question today, would the answer be any different than it was in 2007? I'm certain that if there is such a feature or technique, and if someone can give me the general idea, I can figure out the necessary control statements.
Thanks,
David |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Well, there is nothing fancy to do it that I'm aware of. Why I was asking about your cards is: the posted solution is going through the same data more than once; I'm not sure the posted solution works in all cases. If a high-order key changes but, by coincidence, a lower-order key stays the same, it is going to get blatted.
I wanted to see if what you are doing could be done with OUTFIL reporting functions (along with some code that works) if you are processing the data more than once. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I should read all the code. It probably works, but is a long way round.
I'd make a key of all the elements.
Do a restart on entire key, key minus low-order element, key minus two low-order elements until there is only one part of the key left.
Then test those sequence numbers in reverse order. No ANDs needed. No HIT=NEXT needed. Sequence equal to one, format that key for printing. |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
David sde,
I am not 100% sure as to what you are looking for , here is a sample for you
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
LPAR1 DATA RECORD 1
LPAR1 DATA RECORD 2
LPAR3 DATA RECORD X
LPAR3 DATA RECORD Y
LPAR3 DATA RECORD Z
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC IFOUTLEN=80,
IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,4,ZD,RESTART=(1,5))),
IFTHEN=(WHEN=(81,4,ZD,GT,1),OVERLAY=(1:5X))
//* |
The output is
Code: |
LPAR1 DATA RECORD 1
DATA RECORD 2
LPAR3 DATA RECORD X
DATA RECORD Y
DATA RECORD Z
|
|
|
Back to top |
|
|
David Sde
New User
Joined: 24 Apr 2011 Posts: 23 Location: USA
|
|
|
|
Kolusu,
That solution is perfect; thank you so much!
David |
|
Back to top |
|
|
|