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
 

 

HOW TO SELECT SPECIFIED FIELDS IN A FILE TO AN OUTPUT FILE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sreenatha

New User


Joined: 21 Dec 2005
Posts: 7

PostPosted: Wed Jan 04, 2006 11:02 am    Post subject: HOW TO SELECT SPECIFIED FIELDS IN A FILE TO AN OUTPUT FILE
Reply with quote

HOW TO SELECT SPECIFIED FIELDS IN A FILE TO AN OUTPUT FILE

FOR EG:

INPUT HAS A LRECL OF 724 RECORDS LIKE

Code:

      NUMBER      NAME   DATE  ETC
      1           A      XXX   XXX


I WANT THE OUTPUT FILE AS

Code:

      NUMBER      NAME
      1           A
      2           B


HOW TO DO THIS WITH DF SORT
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Wed Jan 04, 2006 11:53 am    Post subject: Re: HOW TO SELECT SPECIFIED FIELDS IN A FILE TO AN OUTPUT FI
Reply with quote

What is your fields attribute, length of number, name etc.
Will it be having Duplicates in OUT.

Regards,

Priyesh.
Back to top
View user's profile Send private message
meenasomu

New User


Joined: 15 Sep 2005
Posts: 17

PostPosted: Wed Jan 04, 2006 2:46 pm    Post subject:
Reply with quote

Hi,

Will this help you?

Code:

//STEP001 EXEC PGM=SORT                     
//SORTIN DD *                               
12345ABCDEFGHIJKL67890MNOPQRST             
12345ABCDEFGHIJKL67890MNOPQRST             
/*                                         
//SORTOUT DD SYSOUT=*                       
//SYSOUT DD SYSOUT=*                       
//SYSPRINT DD SYSOUT=*                     
//SYSIN DD *                               
  SORT FIELDS=(6,2,CH,A)                   
  SUM FIELDS=NONE                           
  OUTREC FIELDS=(1:6,4,6:12,4)     
/*                                         

The output will be
ABCD     GHIJ 



The 6th column in the input rec will be at the 1st col of the output rec. The length will be 4.

If you use a SORT FIELDS=COPY, the duplicates will not be removed.

Thanks,
Meena.
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 Jan 04, 2006 9:24 pm    Post subject:
Reply with quote

If you just want to keep the first 22 bytes of each record as shown in your example, you can use these DFSORT statements:

Code:

   OPTION COPY
   OUTREC FIELDS=(1,22)


If you want to do something else, you need to explain in detail what you want to do.

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/servers/storage/support/software/sort/mvs/srtmpub.html
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 Incorrect output when trying to add n... monica1 PL/I & Assembler 7 Fri Jan 13, 2017 5:02 pm
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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