View previous topic :: View next topic
|
Author |
Message |
harinair_kn Warnings : 2 New User
Joined: 27 Feb 2006 Posts: 16 Location: India
|
|
|
|
I have a 10 byte length data. I need the data from 5th position to 8 th position in my output.Can anybody help me in this situatuion? |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Code: |
//SYSIN DD *
OPTION COPY
INREC BUILD=(5,4)
/* |
If I'm wrong, please tell us more about your requirement, with sample input and output records you expect, data set attributes and the Sort product/version you are using. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
does it mean the output length will now be 4 bytes long ?
Gerry |
|
Back to top |
|
|
harinair_kn Warnings : 2 New User
Joined: 27 Feb 2006 Posts: 16 Location: India
|
|
|
|
Yes. The output length should contain only 4 bytes |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
the solution provided will do the trick.
Gerry |
|
Back to top |
|
|
harinair_kn Warnings : 2 New User
Joined: 27 Feb 2006 Posts: 16 Location: India
|
|
|
|
I have one more request. The input file I have to sort and after that I need to copy the specific data. What should be done in that case? |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Quote: |
Please tell us more about your requirement(SORT/COPY Criteria), with sample input and output records you expect, data set attributes and the Sort product/version you are using. |
|
|
Back to top |
|
|
Alexis Sebastian
New User
Joined: 04 Mar 2010 Posts: 38 Location: DC
|
|
|
|
Hi,
It can be done using sort.
As Gnana Sekaran Nallathambi mentioned, you have to provide us the clear information of what actually needs to be done?
Thanks in advance!!! |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
I have one more request. The input file I have to sort and after that I need to copy the specific data. What should be done in that case? |
Based on your description, you can use DFSORT control statements like this:
Code: |
SORT FIELDS=(p,m,f,s)
OUTREC BUILD=(5,4)
|
where p,m,f,s is the starting position, length, format and sequence of the field you want to sort on (you can use multiple sort fields if appropriate).
Note that the OUTREC statement is processed after the records are sorted, whereas the INREC statement is processed before the records are sorted.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
Back to top |
|
|
|