IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Copy record based on Condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Aug 05, 2010 9:57 am
Reply with quote

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
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 05, 2010 7:08 pm
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Aug 05, 2010 9:45 pm
Reply with quote

Group will always starts with 2604.


Thanks
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu Aug 05, 2010 9:54 pm
Reply with quote

rgupta71,
Could you please answer other questions as well along with expected output?

Thanks,
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 05, 2010 9:57 pm
Reply with quote

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
View user's profile Send private message
rgupta71

Active User


Joined: 21 Jun 2009
Posts: 160
Location: Indore

PostPosted: Thu Aug 05, 2010 9:59 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Aug 05, 2010 10:37 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Aug 05, 2010 11:20 pm
Reply with quote

What , oh what, has happened to psychic day. . . icon_cool.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts VB to VB copy - Full length reached SYNCSORT 8
Search our Forums:

Back to Top