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
 

 

Need help to get Multiple counts

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need help to get Multiple counts
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 Moderator


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

PostPosted: Tue Nov 13, 2007 2:26 am    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Nov 13, 2007 9:56 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Tue Nov 13, 2007 11:38 pm    Post subject:
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    Post subject:
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    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 Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 2 Tue May 09, 2017 6:31 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


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