Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
No new posts Copy selected columns from 2 input fi... Poha Eater DFSORT/ICETOOL 3 Thu Nov 02, 2017 3:43 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us