View previous topic :: View next topic
|
Author |
Message |
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Hi All,
Is it possible using DFSORT to copy record in below manner
FOr example Input File is
2604,ABCD
Data of 3-4 lines
2604,ABCE
Data of 5-6 lines
2604,ABCF
Data of 1-2 lines
I want to copy data corresponding to 1st and 3rd 2604.
Output File will have
2604,ABCD
Data of 3-4 lines
2604,ABCF
Data of 1-2 lines
Thanks. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
rgupta71,
Are first 4 bytes always same for a single group? 2604 in your shown example.
Do you always want to copy 1st and 3rd record set for a group? What if you have 5 or 10 recordset in a group(Example shown below)? Do you want to copy just odd number of record set within a group?
What is expected output for below records? Please provide LRECL and RECFM for input file.
Code: |
2604,ABCD
Data of 3-4 lines
2604,ABCE
Data of 5-6 lines
2604,ABCF
Data of 1-2 lines
2605,ABCD
Data of 3-4 lines
2605,ABCE
Data of 5-6 lines
2605,ABCF
Data of 1-2 lines
2605,ABCG
Data of 1-2 lines
2605,ABCH
Data of 1-2 lines
2606,ABCD
Data of 3-4 lines
2606,ABCE
Data of 5-6 lines
2606,ABCF
Data of 5-6 lines
2606,ABCG
Data of 5-6 lines
2606,ABCH
Data of 1-2 lines
2606,ABCI
Data of 5-6 lines
2606,ABCJ
Data of 1-2 lines
|
Thanks, |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
Group will always starts with 2604.
Thanks |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
rgupta71,
Could you please answer other questions as well along with expected output?
Thanks, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
sqlcode1,
he does not want to write the code/control cards,
and you expect him to waste his time trying to adequately describe the situation? |
|
Back to top |
|
|
rgupta71
Active User
Joined: 21 Jun 2009 Posts: 160 Location: Indore
|
|
|
|
The Input will not have data of type
2605,ABCD
Data of 3-4 lines
2605,ABCE
Data of 5-6 lines
2605,ABCF
Data of 1-2 lines
2605,ABCG
Data of 1-2 lines
2605,ABCH
Data of 1-2 lines
2606,ABCD
Data of 3-4 lines
2606,ABCE
Data of 5-6 lines
2606,ABCF
Data of 5-6 lines
2606,ABCG
Data of 5-6 lines
2606,ABCH
Data of 1-2 lines
2606,ABCI
Data of 5-6 lines
2606,ABCJ
Data of 1-2 lines
So the valid input portion is
2604,ABCD
Data of 3-4 lines
2604,ABCE
Data of 5-6 lines
2604,ABCF
Data of 1-2 lines
Output based on the condition is given in the initial post.
Thanks. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
rgupta71,
How do you expect anyone to help you when you can't explain what you want clearly. You've shown data with 2604 for input and output, then you show data with 2605 and 2606 for input and three 2604 groups for output when you previously said you want the first and third groups for output. How is anyone supposed to make sense of that?
sqlcode1 asked you several relevant questions about what you're trying to do but you didn't answer them.
If you can't explain what you're trying to do, then nobody can help you.
Show a good example of your input records and expected output. Explain the rules for getting from input to output (do you always want the first and third groups, or is the rule something more complex than that?). Give the RECFM and LRECL of the input file. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
What , oh what, has happened to psychic day. . . |
|
Back to top |
|
|
|