View previous topic :: View next topic
|
Author |
Message |
gprerna
New User
Joined: 21 Mar 2007 Posts: 38 Location: US
|
|
|
|
Hi,
I have a requirement where in, i have a file with below data:
Code: |
ERROR SUDIPTA ABCDEFGH
ERROR SUDIPTA ABC
ERROR SUDIPTA
ERROR NEHA ABCDE
ERROR SUDIPTA AB |
In the output file i want the output as:
is there a way to do this thru a sync sort. I tried to use the below code:
Code: |
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(1,80,SS,EQ,C'SUDIPTA') |
but the output is not as what i expected. It gave me the below o/p:
Code: |
ERROR SUDIPTA ABCDEFGH
ERROR SUDIPTA ABC
ERROR SUDIPTA
ERROR SUDIPTA AB |
Please let me know how we can handle this either thru a sync sort or thru a EZT.
Thanks! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You "told" the sort to include every record containing SUDIPTA - that is what it did.
For us to be able to provide anything usefull (unless someone makes a lucky guess) you need to clearly describe your "rule(s). You need to explain why the desired output is desired (rather than what you received that does not meet your requirement). |
|
Back to top |
|
|
gprerna
New User
Joined: 21 Mar 2007 Posts: 38 Location: US
|
|
|
|
yes, thats what the sort did. For my requirement the o/p should be:
In the output file i want the output as:
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Like Dip, he wants it parsed.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe we understand what you want as output. . . .
Now, you need to explain what the rules are to get there using your input data.
You looked at your data and "knew" what the output should be. We don't "know" and you need to explain in detail what caused you to choose that particular set of output.
If the requirement includes more than what you've posted, you need to include that as well. |
|
Back to top |
|
|
Devzee
Active Member
Joined: 20 Jan 2007 Posts: 684 Location: Hollywood
|
|
|
|
You mentioned that whichever records are having SUDIPTA will be selected.
Then 3rd line
also should be selected right? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
I believe it should not be selected.
Hopefully, we will get the "rules" and then maybe we can help. . . . |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
I guess the output file will contain the the data followed by SUDIPTA...if this is the req. And I think as the position of SUDIPTA is varying...capturing teh data followed by SUDIPTA would be difficult using JCL...can DFSORT/ICETOOL can handle this....I hope Frank can answer this...Master in DFSORT....:-)!!! |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Until the complete "rules" are posted, any suggestions/solutions are just a guess.
Maybe the rules will be posted. . . . |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
can DFSORT/ICETOOL can handle this |
Yes, with DFSORT's PARSE function. For example, let's say the requirement is to get each nonblank value after 'SUDIPTA ' and the value can be a maximum of 10 bytes. This DFSORT job would do it.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ERROR SUDIPTA ABCDEFGH
ERROR SUDIPTA ABC
ERROR SUDIPTA
ERROR NEHA ABCDE
ERROR SUDIPTA AB
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INCLUDE COND=(1,80,SS,EQ,C'SUDIPTA')
INREC PARSE=(%01=(STARTAFT=C'SUDIPTA ',FIXLEN=10)),
BUILD=(%01,80:X)
OUTFIL OMIT=(1,10,CH,EQ,C' ')
/*
|
|
|
Back to top |
|
|
|