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

Data from 5th position to 8 th position in my output


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harinair_kn
Warnings : 2

New User


Joined: 27 Feb 2006
Posts: 16
Location: India

PostPosted: Wed May 12, 2010 11:58 am
Reply with quote

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
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 12, 2010 12:18 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed May 12, 2010 12:25 pm
Reply with quote

Hi,

does it mean the output length will now be 4 bytes long ?

Gerry
Back to top
View user's profile Send private message
harinair_kn
Warnings : 2

New User


Joined: 27 Feb 2006
Posts: 16
Location: India

PostPosted: Wed May 12, 2010 12:48 pm
Reply with quote

Yes. The output length should contain only 4 bytes
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed May 12, 2010 12:52 pm
Reply with quote

Hi,

the solution provided will do the trick.


Gerry
Back to top
View user's profile Send private message
harinair_kn
Warnings : 2

New User


Joined: 27 Feb 2006
Posts: 16
Location: India

PostPosted: Wed May 12, 2010 2:29 pm
Reply with 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?
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:32 pm
Reply with quote

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
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Wed May 12, 2010 5:09 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Wed May 12, 2010 11:10 pm
Reply with quote

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
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 Store the data for fixed length COBOL Programming 1
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
Search our Forums:

Back to Top