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

reformatting using DFSORT


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

Active User


Joined: 22 Dec 2005
Posts: 116

PostPosted: Mon May 12, 2008 12:45 pm
Reply with quote

I have a file like this.

Code:

Emp Id    Seq No.      Status      Sorid
1              1            a         AB
1              2            r         BC
1              3            a         CD
1              4            r         DE
2              1            a         AB
2              2            r         BC
2              3            a         CD
2              4            a         DE



I need the output like

Code:

1              3            a         CD
2              4            a         DE


That means I need the employee id records with status 'a' and of maximum sequence number. Can this be achieved using DFSORT.
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: Mon May 12, 2008 9:07 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
1              1            a         AB
1              2            r         BC
1              3            a         CD
1              4            r         DE
2              1            a         AB
2              2            r         BC
2              3            a         CD
2              4            a         DE
/*
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,1,CH) FIRST USING(CTL1)
/*
//CTL1CNTL DD *
  INCLUDE COND=(29,1,CH,EQ,C'a')
  SORT FIELDS=(1,1,CH,A,16,1,ZD,D)
/*
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
No new posts DFSORT - VB file RDW getting overridden DFSORT/ICETOOL 3
Search our Forums:

Back to Top