Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Stock with SECTIONS=.......... Can somebody assist?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Fri Jul 16, 2010 2:58 am    Post subject: Stock with SECTIONS=.......... Can somebody assist?
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 Moderator


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

PostPosted: Fri Jul 16, 2010 3:07 am    Post subject:
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: 53

PostPosted: Fri Jul 16, 2010 3:16 am    Post subject: Reply to: Stock with SECTIONS=.......... Can somebody assist
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 Moderator


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

PostPosted: Fri Jul 16, 2010 3:35 am    Post subject:
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: 53

PostPosted: Fri Jul 16, 2010 6:11 am    Post subject: Reply to: Stock with SECTIONS=.......... Can somebody assist
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    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 Mainframe 'Abend Assist' for Windows 10 mcmillan Site Announcements 0 Mon Feb 08, 2016 9:02 pm
No new posts JOINKEYS - almost done, but slight pr... rmd3003 SYNCSORT 5 Fri May 24, 2013 8:54 pm
No new posts How to get unique count inside dfsort... Kiruthi R DFSORT/ICETOOL 7 Wed Sep 21, 2011 11:17 am
No new posts SECTIONS= summarization with multiple... madmartinsonxx DFSORT/ICETOOL 1 Sat Aug 06, 2011 1:32 am
No new posts Story about SECTIONS/PARAGRAPHS/&... dbzTHEdinosauer General Talk & Fun Stuff 0 Wed Apr 27, 2011 3:19 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us