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
 

 

Want to sort Flat file

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

New User


Joined: 25 Nov 2005
Posts: 44
Location: Pune

PostPosted: Fri Jun 30, 2006 11:48 am    Post subject: Want to sort Flat file
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: 182
Location: hyderabad

PostPosted: Fri Jun 30, 2006 12:20 pm    Post subject:
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 Moderator


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

PostPosted: Fri Jun 30, 2006 8:50 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/


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    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 splitting of file using XMITIP abdulrafi TSO/ISPF 3 Mon Mar 27, 2017 3:01 pm
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm


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