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

Want to sort Flat file


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

New User


Joined: 25 Nov 2005
Posts: 49
Location: Pune

PostPosted: Fri Jun 30, 2006 11:48 am
Reply with quote

I have the Flat file with RECFM = VB.
The records are Eno,Ename,Salary.I do not know the
length of Ename field and Salary starts imediately after the Ename field , like:

100011PRASHANT15000
100054AVINASHJAIN12000
100032MOHITSHARMA17000
100012HEMANT10000

Now I want the file to sort on ' Salary '.

Can anyone suggest the way ?
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Fri Jun 30, 2006 12:20 pm
Reply with quote

Hi,
I am not sure this is possible with SORT.But you can code an Exit routine for sort and can achive the desired results.

Thank you
Krishy
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: Fri Jun 30, 2006 8:50 pm
Reply with quote

Prashant,

You can use the following DFSORT job to do what you asked for. You'll need z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006) in order to use DFSORT's PARSE function. If you have DFSORT, but you don't have the April, 2006 PTF, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the April, 2006 PTF, see:

Use [URL] BBCode for External Links


Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  INREC PARSE=(%01=(ABSPOS=11,FIXLEN=6,
    STARTAT=C'0',STARTAT=C'1',STARTAT=C'2',STARTAT=C'3',
    STARTAT=C'4',STARTAT=C'5',STARTAT=C'6',STARTAT=C'7',
    STARTAT=C'8',STARTAT=C'9')),
   BUILD=(1,4,5:%01,11:5)
  SORT FIELDS=(5,6,UFF,A)
  OUTREC BUILD=(1,4,5:11)
/*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top