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

copying after the matched record is found


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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
Reply with quote

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

Deepak,

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

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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
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
Search our Forums:

Back to Top