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

Stock with SECTIONS=.......... Can somebody assist?


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

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Fri Jul 16, 2010 2:58 am
Reply with quote

I have an input file with key in POS 1-4 and 6-8. I need to group by those keys and count has to be inserted horizontally. Also it has to summarize AMNT1 and AMNT2 columns

INPUT
Code:
----+----1----+----2
TYPE  ID AMNT1 AMNT2
1111 AAA 00001 00001
1111 AAA 00001 00001
1111 BBB 00002 00002
1111 BBB 00002 00002
2222 AAA 00003 00003
2222 AAA 00003 00003
2222 CCC 00004 00004
2222 CCC 00000 00000


Right now I'm using SECTIONS but it works not the way I want and I'm completely lost. How to get output shown below (report type):

Code:
TYPE     AAA  BBB  CCC  AMNT1 AMNT2
1111       2    2    0  00006 00006
2222       2    0    2  00010 00010
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 Jul 16, 2010 3:07 am
Reply with quote

Is the ID always either AAA, BBBB or CCC, or can there be more variations (e.g. DDD, EEE, etc)? If more, what is the maximum number of different IDs and what are the possible variations (e.g. could BBBB be missing)?

What is the RECFM and LRECL of the input file?
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Fri Jul 16, 2010 3:16 am
Reply with quote

Yes, it's always AAA, BBB or CCC. Actually report is much more complex but I will handle it as long as in right direction. Thanks in advance....
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 Jul 16, 2010 3:35 am
Reply with quote

You can use a DFSORT job like the following to do what you asked for:

Code:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1111 AAA 00001 00001
1111 AAA 00001 00001
1111 BBB 00002 00002
1111 BBB 00002 00002
2222 AAA 00003 00003
2222 AAA 00003 00003
2222 CCC 00004 00004
2222 CCC 00000 00000
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  INREC IFTHEN=(WHEN=(6,3,CH,EQ,C'AAA'),
    BUILD=(1,4,9:C'0001',14:C'0000',19:C'0000',25:10,5,31:16,5)),
   IFTHEN=(WHEN=(6,3,CH,EQ,C'BBB'),
    BUILD=(1,4,9:C'0000',14:C'0001',19:C'0000',25:10,5,31:16,5)),
   IFTHEN=(WHEN=(6,3,CH,EQ,C'CCC'),
    BUILD=(1,4,9:C'0000',14:C'0000',19:C'0001',25:10,5,31:16,5))
  OUTFIL REMOVECC,NODETAIL,
    HEADER2=('TYPE     AAA  BBB  CCC  AMNT1 AMNT2'),
    SECTIONS=(1,4,
      TRAILER3=(1,4,
       9:TOT=(9,4,ZD,EDIT=(IIIT)),
      14:TOT=(14,4,ZD,EDIT=(IIIT)),
      19:TOT=(19,4,ZD,EDIT=(IIIT)),
      25:TOT=(25,5,ZD,EDIT=(TTTTT)),
      31:TOT=(31,5,ZD,EDIT=(TTTTT))))
/*
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 55

PostPosted: Fri Jul 16, 2010 6:11 am
Reply with quote

Frank, thank you very much. You guys here are the best.
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 getting subtotals for multiple sections SYNCSORT 4
No new posts Sections: need one appearance of cer... DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. ASSIST/GT with CICS CICS 1
No new posts Announcement: Mainframe 'Abend Assist' Ver 2.0 for ... Site Announcements 1
No new posts JOINKEYS - almost done, but slight pr... SYNCSORT 5
Search our Forums:

Back to Top