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

Need help on DFSORT Match


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

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Thu Nov 11, 2010 2:43 pm
Reply with quote

Below is my input file KSDS max Record size is 500

Key is first 8 char

Input:-
Code:
123455TX   07012010
123455TX   AD12
123455TX   AB11
123456TX   07012010
123456TX   AD12
123456TX   AB11
123466TX   08012010
123466TX   AD12
123466TX   AB11
123466TX   AB11
123466TX   AB11
123476TX   08112010
123476TX   AD12
123476TX   AB11
123476TX   AB11
123476TX   AB11
123476TX   AB11


I want the count of AB11 per key after 08012010 date

Output:-
Code:

123466TX   3
123476TX   4
Back to top
View user's profile Send private message
shrivatsa
Warnings : 1

Active User


Joined: 17 Mar 2006
Posts: 174
Location: Bangalore

PostPosted: Thu Nov 11, 2010 7:44 pm
Reply with quote

Hi Frank,

Can you please assist on this?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Nov 11, 2010 7:58 pm
Reply with quote

The DFSORT wizards are in a completely different time zone to you.
Please be patient
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 Nov 12, 2010 2:13 am
Reply with quote

shrivatsa,

Here's a DFSORT job that will do what I think you're asking for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (VSAM)
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY,VLSCMP
  RECORD TYPE=V
  INCLUDE COND=(21,4,CH,EQ,C'AB11',OR,21,8,FS,EQ,NUM)
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,21:5)),
   IFTHEN=(WHEN=GROUP,BEGIN=(37,8,FS,EQ,NUM),
    PUSH=(5:41,4,9:37,4,13:ID=8))
 OUTFIL REMOVECC,NODETAIL,
    INCLUDE=(5,8,CH,GE,C'20100801'),
    SECTIONS=(13,8,
      TRAILER3=(21,8,X,COUNT-1=(EDIT=(IIIIIIIT))))
/*
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