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
 

 

copying after the matched record is found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Sep 20, 2011 12:59 pm    Post subject: copying after the matched record is found
Reply with quote

Hi,

I have input dataset as mentioned below:

1
2
3
4
TRAILER
5
6
7

I want output dataset should contain:
TRAILER
5
6
7

Could anyone of you suggest.
Back to top
View user's profile Send private message

THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Sep 20, 2011 3:01 pm    Post subject:
Reply with quote

Let us know the Lrecl,recfm of the file.
Back to top
View user's profile Send private message
nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Tue Sep 20, 2011 3:03 pm    Post subject:
Reply with quote

Hi Deepak,

Your example is not very clear and you have not provided any rules to achieve your output. Please answer the below question.

1, Will the input file have only one 'TRAILER' record?
2, IF Multiple record found, what needs to done?
3, In subject you have mentioned 'Matching record'. How to identify Matching records?
4, What is the RECFM and LRECL of your IN/OUT files.
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Sep 20, 2011 3:15 pm    Post subject:
Reply with quote

1, Will the input file have only one 'TRAILER' record?
Yes it will have only one 'TRAILER' record

2, IF Multiple record found, what needs to done?
N/A

3, In subject you have mentioned 'Matching record'. How to identify Matching records?
Matching record is the 'TRAILER' record. Once the control reaches there all the records after that should be written to output file including TRAILER records.

4, What is the RECFM and LRECL of your IN/OUT files.
RECFM is Fixed block and LRECL is 80 of IN/OUT files.

Please let me know in case you need any additional information.
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Tue Sep 20, 2011 3:20 pm    Post subject:
Reply with quote

Assuming that it is FB and record length 80.

Code:

//SYSIN    DD *                                                       
 OPTION COPY                                                         
 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,7,CH,EQ,C'TRAILER'),PUSH=(81:ID=1))
 OUTFIL OMIT=(81,1,CH,EQ,C' '),BUILD=(1,80)                           
Back to top
View user's profile Send private message
deepak.kec

New User


Joined: 26 Feb 2007
Posts: 71
Location: bangalore

PostPosted: Tue Sep 20, 2011 3:33 pm    Post subject:
Reply with quote

Thanks a ton!!!it worked
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: Tue Sep 20, 2011 10:33 pm    Post subject:
Reply with quote

Deepak,

Note that this solution (and many others) are covered by my "Smart DFSORT Tricks" paper at:

http://www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000094
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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