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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Data from 5th position to 8 th position in my output
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: 788
Location: Chennai, India

PostPosted: Wed May 12, 2010 12:18 pm    Post subject:
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: 1703
Location: Australia

PostPosted: Wed May 12, 2010 12:25 pm    Post subject:
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    Post subject: Query
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: 1703
Location: Australia

PostPosted: Wed May 12, 2010 12:52 pm    Post subject:
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    Post subject:
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: 788
Location: Chennai, India

PostPosted: Wed May 12, 2010 2:32 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed May 12, 2010 11:10 pm    Post subject:
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:

http://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    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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm


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