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
 
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: 183
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

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