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
 

 

Compose an ICETOOL control deck to print a report

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

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 12, 2007 3:05 am    Post subject: Compose an ICETOOL control deck to print a report
Reply with quote

My specifications are as follows:

Input file is: FB

Record length is: 144

Record format of the first 40 bytes are:

Code:

----+----1----+----2----+----3----+----4
********************************* Top of
CB6W001001QP05693      352022
CB6W001001MI11786      69230
CB6W001001MP01767      39303
CB6W001001JP01523      49226
CB6W001001XG80055      69100
CB6W001001XP09318      20021
CB6W001001MP09253      150022
CB6W001001MP10266      150031
CB6W001001MP01411      39142
CB6W001001M338257      69096
CB6W001001M884695      41150
CB6W001001MP11148      150208
CB6W001002MP01183      39092
CB6W001002XP01433      19428
CB6W001002XC07573      197100


Beginning in column 5 for a length of 6 is Customer number.

Beginning in column 11 for a length of 1 is Customer order entry method.

I am trying to compose an ICETOOL control deck to print a report based on the following criteria:

The first task in my current assignment I have completed (displaying Customer number and that count when the Customer number is ?001001? or ?001002? or '063888').

I am having trouble w/the second task in my current assignment.

The way that I had decided to do the second task of my current assignment is to create a second report

The second report will contain the sum of those occurrences where Customer Number ?001001? and Customer order entry method of ?M?

Also a report line containing the sum of those occurrences where Customer Number ?001001? and Customer order entry method not equal to ?M?.

Desired output based on the previous record format

Code:

  Customer Number        Order Entry Count (M)   Order Entry (Not M)
     001001                             8                         4


I have included the JCL I am currently using.

Code:

//STEP01  EXEC PGM=ICETOOL
//TOOLMSG DD   SYSOUT=*
//DFSMSG  DD   SYSOUT=*
//IN      DD   DSN=&&TEMP1,
//             DISP=OLD
//RPT     DD   SYSOUT=*
//RPT1   DD   SYSOUT=*
//TOOLIN  DD    *
  OCCUR FROM(IN) LIST(RPT) -
  HEADER('CUSTOMER NBR') ON(5,6,CH) -
  TITLE('CUSTOMER NBR COUNTS') -
  DATE(MD4/) BLANK -
  HEADER('COUNT') ON(VALCNT)
*
  OCCUR FROM(IN) LIST(RPT1) -
  TITLE('ORDER ENTRY COUNTS') -
  DATE(MD4/) BLANK -
  HEADER('CUSTOMER NBR') ON(5,6,CH) -
  HEADER('ORDER ENTRY ') ON(11,1,CH) -
  HEADER('COUNT') ON(VALCNT)
//*


Thank you for your help.
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: Thu Apr 12, 2007 4:07 am    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. Adjust as necessary to get RPT3 looking the way you want it. I've added BBcode tags to your post. Please try to use them in the future as it helps for readability.

Code:

//STEP01  EXEC PGM=ICETOOL
//TOOLMSG DD   SYSOUT=*
//DFSMSG  DD   SYSOUT=*
//IN      DD   DSN=&&TEMP1,
//             DISP=OLD
//RPT     DD   SYSOUT=*
//RPT1   DD   SYSOUT=*
//RPT2   DD   SYSOUT=*
//TOOLIN  DD    *
  OCCUR FROM(IN) LIST(RPT) -
  HEADER('CUSTOMER NBR') ON(5,6,CH) -
  TITLE('CUSTOMER NBR COUNTS') -
  DATE(MD4/) BLANK -
  HEADER('COUNT') ON(VALCNT)
*
  OCCUR FROM(IN) LIST(RPT1) -
  TITLE('ORDER ENTRY COUNTS') -
  DATE(MD4/) BLANK -
  HEADER('CUSTOMER NBR') ON(5,6,CH) -
  HEADER('ORDER ENTRY ') ON(11,1,CH) -
  HEADER('COUNT') ON(VALCNT)
*
  COPY FROM(IN) USING(CTL1)
/*
//CTL1CNTL DD *
  INCLUDE COND=(5,6,CH,EQ,C'001001')
  INREC IFTHEN=(WHEN=INIT,
    BUILD=(5,6,8:11,1,25:15C'0',47:15C'0')),
   IFTHEN=(WHEN=(8,1,CH,EQ,C'M'),
    OVERLAY=(39:C'1')),
   IFTHEN=(WHEN=NONE,
    OVERLAY=(61:C'1'))
  OUTFIL FNAMES=RPT2,NODETAIL,
    TRAILER1=(1:'Customer Number',19:'Order Entry Count (M)',
      43:'Order Entry (Not M)',/,
      1,6,25:TOT=(25,15,ZD,M10,LENGTH=15),
          47:TOT=(47,15,ZD,M10,LENGTH=15))
/*


RPT2 will have:

Code:

Customer Number   Order Entry Count (M)   Order Entry (Not M) 
001001                                8                     4 
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 12, 2007 9:30 pm    Post subject: Re: Compose an ICETOOL control deck to print a report
Reply with quote

Thank you for your timely reply.
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 19, 2007 1:39 am    Post subject: I was able to test and the test was successful
Reply with quote

Frank, I was just able to test your posted resolution (due to our shop transitioning to a "new" machine) and the test was successful.

Thank you for your help.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu Apr 19, 2007 2:25 am    Post subject:
Reply with quote

Mr Bill Ross,
a double thank you for the confirmation of success.
Another Bill.....
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Thu Apr 19, 2007 11:38 pm    Post subject: The requirements have changed
Reply with quote

The requirements for this task have changed and I could use your help again. Instead of printing a report I now need ICETOOL to create a file w/the same fields as the report.

The output record will be 80 bytes. The output should consist of 3 records, one record for each Customer number (ITO-CUST-NBR) of which there are 3 (?001001? ?001002? and ?036888?). and an associated total (ITO-CUST-NBR-TTL) of those input records.

In the record that contains the Customer number ?001001? there should also be a total field of those records that are(Customer number ?001001? and order entry of ?M?) (ITO-CUST-ORD-ENT-M-TTL), also in that same record a field that contains the total of those records that are (Customer number ?001001? and order entry in not equal to ?M?) (ITO-CUST-ORD-ENT-NOT-M-TTL).

The other two output records will contain Customer number
(?001002? and ?036888?) and a total count field of those input records.

If there are no corresponding Customer number records in the input create no record.

Code:
I have included an FD for the proposed output:

        01  ICE-TOOL-OUT.
   05  ITO-CUST-NBR                         PIC X(06).
   05  ITO-CUST-NBR-TTL                     PIC 9(06).
   05  ITO-CUST-ORD-ENT-M-TTL          PIC 9(06).
   05  ITO-CUST-ORD-ENT-NOT-M-TTL   PIC 9(06).
   05  FILLER                                        PIC X(56).

The starting position and length of the input fields remain:

Customer number begins in column 5 for a length of 6
Order Entry begins in column 11 for a length of 1.

I have included a file layout (first 20 bytes) of the input file, also a file layout (first 70 bytes) of the desired output file.

Thank you in advance

Code:
Input: (The first twenty (20) bytes)
----+----1----+----2
CB6W001001XP01018
CB6W001001M338257
CB6W001001MP01120
CB6W001001MP00249
CB6W001001MP00274
CB6W001001MP01183
CB6W001001M884695
CB6W001001MP10661
CB6W001001MP07620
CB6W001001MP08707
CB6W001001MI11789
CB6W001001JP01411
CB6W001001O338231
CB6W001001O338257
CB6W001002MP01120
CB6W001002MP00249
CB6W036888XP01018



Code:
Desired output: (The first seventy (70) bytes)
----+----1----+----2----+----3----+----4----+----5----+----6----+----7
001001000014000010000004          -        Spaces  -
001002000002000000000000          -        Spaces  -
036888000001000000000000          -        Spaces  -
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 Apr 20, 2007 1:19 am    Post subject:
Reply with quote

Here's a DFSORT job that will produce the file you asked for:

Code:

//S2  EXEC PGM=ICEMAN
//SYSOUT  DD   SYSOUT=*
//SORTIN  DD   DSN=...  input file
//SORTOUT DD   DSN=...  output file
//SYSIN   DD    *
  INREC IFOUTLEN=80,
   IFTHEN=(WHEN=INIT,
    BUILD=(1:5,6,7:11,1,13:6C'0',19:6C'0')),
   IFTHEN=(WHEN=(1,6,CH,EQ,C'001001',AND,7,1,CH,EQ,C'M'),
    OVERLAY=(18:C'1')),
   IFTHEN=(WHEN=(1,6,CH,EQ,C'001001',AND,7,1,CH,NE,C'M'),
    OVERLAY=(24:C'1'))
  SORT FIELDS=(1,6,CH,A)
  OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,
    SECTIONS=(1,6,
      TRAILER3=(1,6,COUNT=(M11,LENGTH=6),
        TOT=(13,6,ZD,M11,LENGTH=6),
        TOT=(19,6,ZD,M11,LENGTH=6)))
/*
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Fri Apr 20, 2007 2:25 am    Post subject: Thank you sir
Reply with quote

Thank you Frank it worked like a charm.
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Fri Apr 20, 2007 11:53 pm    Post subject: Correct control statement?
Reply with quote

Because this is one of three files that I will subsequently process I am trying to add a field that will identify the record.

What I would like is to place an 'A' in column 25 of the output record.

I tried

BUILD=(1:5,6,7:11,1,13:6C'0',19:6C'0',25:C'A')),

as you can know this didn't work.

Also I tried

OVERLAY=(25,1,C'A')))

as you know this didn't work either.

What is the correct control statement.?
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: Sat Apr 21, 2007 12:45 am    Post subject:
Reply with quote

I can see why your OVERLAY parameter doesn't work since it's specified incorrectly. It should be:

OVERLAY=(25:C'A'))))

When you specify:

OVERLAY=(25,1,C'A')))

you are telling DFSORT to put input position 25 at output position 1 followed by an 'A' at output position 2.

Your BUILD parameter should also work:

BUILD=(1:5,6,7:11,1,13:6C'0',19:6C'0',25:C'A')),

I don't understand why you say it didn't work. It worked fine for me. If it didn't work for you, show me your //SYSOUT messages.
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Sat Apr 21, 2007 1:18 am    Post subject: Sysout from Build
Reply with quote

Frank here is the Sysout from the build statement:

Code:
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 15:41 ON FRI APR 20, 2007 -
            INREC IFOUTLEN=80,
             IFTHEN=(WHEN=INIT,
              BUILD=(1:5,6,7:11,1,13:6C'0',19:6C'0',25:1C'A')),
             IFTHEN=(WHEN=(1,6,CH,EQ,C'001001',AND,7,1,CH,EQ,C'M'),
              OVERLAY=(18:C'1')),
             IFTHEN=(WHEN=(1,6,CH,EQ,C'001001',AND,7,1,CH,NE,C'M'),
              OVERLAY=(24:C'1'))
            SORT FIELDS=(1,6,CH,A)
            OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,
              SECTIONS=(1,6,
              TRAILER3=(1,6,COUNT=(M11,LENGTH=6),
                      TOT=(13,6,ZD,M11,LENGTH=6),
                      TOT=(19,6,ZD,M11,LENGTH=6)))
ICE201I 0 RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K05352 C6-Q95214 C7-K90000 C8-K05352 E9-K06751 C9-BASE   E5-K08040 E6-K90000 E7-K90000
ICE193I 0 ICEAM1 ENVIRONMENT IN EFFECT - ICEAM1 INSTALLATION MODULE SELECTED
ICE088I 1 ROSS14  .STEP02  .        , INPUT LRECL = 144, BLKSIZE = 27936, TYPE = FBICE093I 0 MAIN STORAGE = (MAX,6291456,6291456)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (6234096,6234096)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,RESET=Y,VSAMEMT=Y,DYNSPC=256
ICE128I 0 OPTIONS: SIZE=6291456,MAXLIM=1048576,MINLIM=450560,EQUALS=N,LIST=Y,ERET=RC16 ,MSGDDN=SYSOUT
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=NO   ,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=N,DYNALOC=(SYSDA   ,004),ABCODE=MSG
ICE130I 0 OPTIONS: RESALL=4096,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=N,STIMER=Y,COBEXIT=COB2
ICE131I 0 OPTIONS: TMAXLIM=6291456,ARESALL=0,ARESINV=0,OVERRGN=65536,CINV=Y,CFW=Y,DSA=0
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=Y,IEXIT=N,TEXIT=N,LISTX=N,EFS=NONE    ,EXITCK=S,PARMDDN=DFSPARM ,FSZEST=N
ICE133I 0 OPTIONS: HIPRMAX=OPTIMAL,DSPSIZE=MAX ,ODMAXBF=2097152,SOLRF=Y,VLLONG=N,VSAMIO=N,MOSIZE=MAX
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 83808 TC 0 CS DSVNN KSZ 6 VSZ 6
ICE752I 0 FSZ=582 RC  IGN=0 E  AVG=80 0  WSP=61 C  DYN=0 0
ICE231I 0 STORAGE USED FOR OUTFIL : BELOW 16M = 47104, ABOVE 16M = 107520
ICE210I 0 SORTOUT  : BSAM USED, LRECL = 80, BLKSIZE = 80, TYPE = FB
ICE751I 1 DE-K90000 D5-K05352 D9-K90000 CB-K90000 E8-K90000
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 390, OUT: 390
ICE227I 0 SORTOUT  : DELETED = 390, REPORT = 3, DATA = 0
ICE228I 0 SORTOUT  : TOTAL IN = 390, TOTAL OUT = 3
ICE174I 0 NO DATA RECORDS FOR AN OUTFIL DATA SET - RC=0
ICE134I 0 NUMBER OF BYTES SORTED: 56160
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 0 , TRACKS USED: 0
ICE199I 0 MEMORY OBJECT STORAGE USED = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
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: Sat Apr 21, 2007 1:34 am    Post subject:
Reply with quote

When you said "it doesn't work", I thought you were getting some kind of error for the syntax. I don't see any error messages.

I'm guessing now when you said "it doesn't work", you meant that the 'A' didn't appear in the records. Well, that's because BUILD will put it in the detail record, but NODETAIL suppresses all of the detail records. Your output is the TRAILER records, not the detail records. If you want to put an 'A' at the end of the trailer records, you can use:

Code:

   TRAILER3=(1,6,COUNT=(M11,LENGTH=6),
                      TOT=(13,6,ZD,M11,LENGTH=6),
                      TOT=(19,6,ZD,M11,LENGTH=6),C'A'))
Back to top
View user's profile Send private message
Bill Ross

New User


Joined: 25 Jan 2007
Posts: 39
Location: Charleston SC

PostPosted: Sat Apr 21, 2007 1:39 am    Post subject: Thank you sir
Reply with quote

Thank you Frank it worked like a charm.
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 How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am


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