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 ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm

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