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

Need help to get Multiple counts


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

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Nov 13, 2007 12:52 am
Reply with quote

Hi Frank..

In need of your help again.. I tried to solve this with the learnings from the previous task but cudn..

here is my input

Code:

1234,ARUN      ,KUMAR   ,EE,5
1234,KISHORE   ,KUMAR   ,DP,5
1234,VARUN     ,RAM     ,EE,5
1234,THARUN    ,PRASAD  ,DP,7
1234,KAMAL     ,KUMAR   ,EE,7
1235,GANESH    ,NAIR    ,EE,6
1235,SELVA     ,PETER   ,DP,6
1235,JOHN      ,NIMAL   ,EE,5
1235,SHEELA    ,PRATAP  ,DP,6


And I need to get an O/P like this one..
Code:

1234  EE DP

 5  -  2  1
 7  -  1  1

1235  EE DP

 6  -  1  2
 5  -  1  0


The first feild is the customer number
The count of EEs and DPs for each customer is required and also that needs to be split with respect to the last digit..

Hope i made it clear...
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: Tue Nov 13, 2007 2:26 am
Reply with quote

Here's a DFSORT job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
1234,ARUN      ,KUMAR   ,EE,5
1234,KISHORE   ,KUMAR   ,DP,5
1234,VARUN     ,RAM     ,EE,5
1234,THARUN    ,PRASAD  ,DP,7
1234,KAMAL     ,KUMAR   ,EE,7
1235,GANESH    ,NAIR    ,EE,6
1235,SELVA     ,PETER   ,DP,6
1235,JOHN      ,NIMAL   ,EE,5
1235,SHEELA    ,PRATAP  ,DP,6
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  INREC IFOUTLEN=11,
   IFTHEN=(WHEN=(26,2,CH,EQ,C'EE'),
    BUILD=(1,4,29,1,7:C'01')),
   IFTHEN=(WHEN=NONE,
    BUILD=(1,4,29,1,10:C'01'))
  SORT FIELDS=(1,5,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(11X),
    SECTIONS=(1,4,
      HEADER3=(/,1,4,7:'EE',10:'DP',/),
     5,1,
      TRAILER3=(2:5,1,5:'-',
        7:TOT=(7,2,ZD,EDIT=(IT)),
       10:TOT=(10,2,ZD,EDIT=(IT))))
/*
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Nov 13, 2007 6:16 pm
Reply with quote

Thnx once again.. Its working good.. Nd i have one more query..

I duno if its possible.. but thought of giving a try...

In my input file if the last feild is 5 then sould move the second feild to the last position.. i,e after the "5"...

rest of the records should be left unchanged... can it be done using icetool..?
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: Tue Nov 13, 2007 9:56 pm
Reply with quote

Please show and explain your expected output for your input example.
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Tue Nov 13, 2007 11:24 pm
Reply with quote

Hi..

Code:

1234,             ,KUMAR   ,EE,5,ARUN       
1234,             ,KUMAR   ,DP,5,KISHORE
1234,              ,RAM     ,EE,5,VARUN   
1234,THARUN    ,PRASAD  ,DP,7
1234,KAMAL     ,KUMAR   ,EE,7
1235,GANESH    ,NAIR    ,EE,6
1235,SELVA     ,PETER   ,DP,6
1235,              ,NIMAL   ,EE,5,JOHN     
1235,SHEELA    ,PRATAP  ,DP,6


The second field in the records having last cgaracter as 5 should be moved to the position after the last feild...
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: Tue Nov 13, 2007 11:38 pm
Reply with quote

Sigh. I guess this is a totally different output unrelated to your original output?

This DFSORT job will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
1234,ARUN      ,KUMAR   ,EE,5
1234,KISHORE   ,KUMAR   ,DP,5
1234,VARUN     ,RAM     ,EE,5
1234,THARUN    ,PRASAD  ,DP,7
1234,KAMAL     ,KUMAR   ,EE,7
1235,GANESH    ,NAIR    ,EE,6
1235,SELVA     ,PETER   ,DP,6
1235,JOHN      ,NIMAL   ,EE,5
1235,SHEELA    ,PRATAP  ,DP,6
/*
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  INREC IFTHEN=(WHEN=(29,1,CH,EQ,C'5'),
    BUILD=(1,5,16:16,14,30:5,10))
/*
Back to top
View user's profile Send private message
sathyaraj

New User


Joined: 28 Sep 2007
Posts: 71
Location: India.

PostPosted: Wed Nov 14, 2007 9:34 pm
Reply with quote

Hi... Yes this is for a different requirement..
Usually we were employing cobol to do this.. Going forward we will be able to save lots of time.. Thnx a lot..
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top