View previous topic :: View next topic
|
Author |
Message |
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
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 |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
Let us know the Lrecl,recfm of the file. |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
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 |
|
|
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
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 |
|
|
THINKSRINIII Warnings : 1 New User
Joined: 09 Jan 2009 Posts: 88 Location: India
|
|
|
|
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 |
|
|
deepak.kec
New User
Joined: 26 Feb 2007 Posts: 71 Location: bangalore
|
|
|
|
Thanks a ton!!!it worked |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
Back to top |
|
|
|