Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy record based on Condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copy record based on Condition
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: 578
Location: USA

PostPosted: Thu Aug 05, 2010 7:08 pm    Post subject:
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    Post subject: Reply to: Copy record based on Condition
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: 578
Location: USA

PostPosted: Thu Aug 05, 2010 9:54 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Aug 05, 2010 10:37 pm    Post subject:
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

Site Director


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

PostPosted: Thu Aug 05, 2010 11:20 pm    Post subject: Reply to: Copy record based on Condition
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us