Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sathyaraj

New User

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

Posted: Tue Nov 13, 2007 12:52 am    Post subject: Need help to get Multiple counts

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..

Frank Yaeger

DFSORT Moderator

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

Posted: Tue Nov 13, 2007 2:26 am    Post subject:

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)))) /*
sathyaraj

New User

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

 Posted: Tue Nov 13, 2007 6:16 pm    Post subject: 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..?
Frank Yaeger

DFSORT Moderator

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

 Posted: Tue Nov 13, 2007 9:56 pm    Post subject: Please show and explain your expected output for your input example.
sathyaraj

New User

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

Posted: Tue Nov 13, 2007 11:24 pm    Post subject:

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...
Frank Yaeger

DFSORT Moderator

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

Posted: Tue Nov 13, 2007 11:38 pm    Post subject:

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)) /*
sathyaraj

New User

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

 Posted: Wed Nov 14, 2007 9:34 pm    Post subject: 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..
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Reformat clause in joinkeys sortcard ... Mounika Nemani DFSORT/ICETOOL 2 Thu May 31, 2018 5:35 pm Splitting one row into multiple Rows ... Rajan Moorthy DFSORT/ICETOOL 9 Mon May 14, 2018 10:58 pm write multiple lines in PS file in cobol Balu5491 COBOL Programming 7 Wed Mar 07, 2018 10:27 am Using multiple routines at exit 6 in ... Randy Horowitz All Other Mainframe Topics 2 Sat Feb 10, 2018 11:57 pm Sum the fields in particular format f... sharana64 DFSORT/ICETOOL 9 Fri Jan 05, 2018 1:11 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us