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

Problem in Writing the Total Count!


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Tue Sep 22, 2009 4:47 pm
Reply with quote

Hi all,

First 5 lines of my Input is Some Junk Data. The remaining sample input is,

Code:


Part -- 1
aaa      yyyyyyyy   23

Part -- 2   
aaa      yyyyyyyy   04
bbb      xxxxxxxx   97

part -- 3   
aaa       yyyyyyyy   20
ccc      dddddddd   02   



My output should look like,


Code:


TOTAL NUMBER OF EXCEPTIONS FOR yyyyyyyy : 47
TOTAL NUMBER OF EXCEPTIONS FOR xxxxxxxx : 97
TOTAL NUMBER OF EXCEPTIONS FOR dddddddd :  2
----------------------------------------------
TOTAL EXCEPTIONS               : 146   

      << END OF REPORT >>



LRECL = 160 and Record Format = FB

This is the Sort step im trying,

Code:


OPTION ZDPRINT,SKIPREC=5                                             
  INCLUDE COND=(53,7,CH,NE,C'       ')                               
  SORT FIELDS=(53,47,CH,A)                                           
  OUTFIL REMOVECC,NODETAIL,                                           
    SECTIONS=(53,47,                                                 
     TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',                 
               TOT=(124,8,UFF,M10,LENGTH=8))),                       
     TRAILER3=(2:'------------------------------------------------',/,
               2:'TOTAL NUMBER OF EXCEPTIONS : ',                     
               30:TOT=(124,8,UFF,M10,LENGTH=8)),                     
     TRAILER1=(60:C' <<<< END OF REPORT >>>> ')                       



let me know where i'm going wrong!!!
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: Tue Sep 22, 2009 9:27 pm
Reply with quote

These DFSORT control statements will work. You can adjust them as needed to get the output in the layout you want:

Code:

  OPTION ZDPRINT,SKIPREC=5
  INCLUDE COND=(53,7,CH,NE,C'       ')
  SORT FIELDS=(53,47,CH,A)
  OUTFIL REMOVECC,NODETAIL,
    SECTIONS=(53,47,
     TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',
               TOT=(124,8,UFF,M10,LENGTH=8))),
     TRAILER1=(2:'------------------------------------------------',/,
               2:'TOTAL EXCEPTIONS : ',
               30:TOT=(124,8,UFF,M10,LENGTH=8),2/,
               60:C' <<<< END OF REPORT >>>> ')
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 1:35 pm
Reply with quote

Hi Frank,

Thanks!!!

Below step is giving syntax error,

Code:


TRAILER1=(2:'------------------------------------------------',/,
               2:'TOTAL EXCEPTIONS : ',
               30:TOT=(124,8,UFF,M10,LENGTH=8),2/,
               60:C' <<<< END OF REPORT >>>> ')


So i have changed the step ,

Code:


TRAILER1=(2/,                                 
          1:'TOTAL EXCEPTIONS : ',           
          21:TOT=(124,8,UFF,M10,LENGTH=8),2/,
          60:C' <<<< END OF REPORT >>>> ')   
                                             


This is the error msg,

Code:


                                                                               
            OPTION ZDPRINT,SKIPREC=5                                           
              INCLUDE COND=(53,7,CH,NE,C'       ')                             
              SORT FIELDS=(53,47,CH,A)                                         
              OUTFIL REMOVECC,NODETAIL,                                         
                SECTIONS=(53,47,                                               
                 TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',               
                           TOT=(124,8,UFF,M10,LENGTH=8))),                     
                 TRAILER1=(2:'------------------------------------------------',
                           2:'TOTAL EXCEPTIONS : ',                             
                         $                                                     
ICE007A 6 SYNTAX ERROR                                                         
                           30:TOT=(124,8,UFF,M10,LENGTH=8),2/,                 
                           $                                                   
ICE007A 0 SYNTAX ERROR                                                         
                           60:C' <<<< END OF REPORT >>>> ')                     
                           $                                                   
ICE007A 0 SYNTAX ERROR                                                         



Correct me if im wrong.
After changing the step i have got the desired result.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Sep 23, 2009 3:05 pm
Reply with quote

Hi,

I'm confused, is it working or not with Frank's code ?


Gerry
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 3:16 pm
Reply with quote

Hi,

Frank code and My first Post was giving syntax errors.
Syntax error was due to this line,

Code:


TRAILER1=(2:'------------------------------------------------',/,



I guess '-----' is not allowed in TRAILER1. Please correct me if im wrong.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Wed Sep 23, 2009 3:23 pm
Reply with quote

Hi,

from the error output
Code:
TRAILER1=(2:'------------------------------------------------',
you are missing a /, from the end of the code

Franks code works perfectly for me.

Gerry
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 3:28 pm
Reply with quote

Hi,

Please check my Log i feel like i have not missed anything,

Code:


                                                                               
          OPTION ZDPRINT,SKIPREC=5                                             
            INCLUDE COND=(53,7,CH,NE,C'       ')                               
            SORT FIELDS=(53,47,CH,A)                                           
            OUTFIL REMOVECC,NODETAIL,                                           
              SECTIONS=(53,47,                                                 
               TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',                 
                         TOT=(124,8,UFF,M10,LENGTH=8))),                       
               TRAILER1=(2:'------------------------------------------------',/,
                         2:'TOTAL EXCEPTIONS : ',                               
                       $                                                       
E007A 6 SYNTAX ERROR                                                           
                         30:TOT=(124,8,UFF,M10,LENGTH=8),2/,                   
                         $                                                     
E007A 0 SYNTAX ERROR                                                           
                         60:C' <<<< END OF REPORT >>>> ')                       
                         $                                                     
E007A 0 SYNTAX ERROR                                                           

Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 3:32 pm
Reply with quote

Hi,

Is there is any limitation for '---------' this line in TRAILER1 COMMAND??
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 3:45 pm
Reply with quote

Hi all,

Frank code is working fine. I have reduced length of '----' this line and it worked fine.

Code:


OPTION ZDPRINT,SKIPREC=5                             
  INCLUDE COND=(53,7,CH,NE,C'       ')               
  SORT FIELDS=(53,47,CH,A)                           
  OUTFIL REMOVECC,NODETAIL,                         
    SECTIONS=(53,47,                                 
     TRAILER3=(C'TOTAL EXCEPTIONS FOR ',53,47,' : ',
               TOT=(124,8,UFF,M10,LENGTH=8))),       
     TRAILER1=(1:'----------------------------',/,   
               1:'TOTAL EXCEPTIONS : ',             
               21:TOT=(124,8,UFF,M10,LENGTH=8),/,   
               1:'----------------------------',2/, 
               60:C' <<<< END OF REPORT >>>> ')     
                                                     
Back to top
View user's profile Send private message
Vigneshwaran S
Warnings : 1

New User


Joined: 10 Dec 2008
Posts: 60
Location: Chennai

PostPosted: Wed Sep 23, 2009 3:47 pm
Reply with quote

Hi,

Sorry for all the confusion.

Just curious to know, Why the same step was giving Syntax error before??
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: Wed Sep 23, 2009 8:41 pm
Reply with quote

Vicky,

The job I gave you works fine providing you do not go past column 71. If you do go past column 71 then it's interpreted as a continuation line which I'm guessing is what caused your error. But I don't know for sure since I don't know where each line starts in your job.

To avoid problems, instead of using all of those - characters, you can use n'-' for the number you want. For example, instead of:

Code:

 TRAILER1=(2:'------------------------------------------------',/,


you can use:

Code:

 TRAILER1=(2:48'-',/, 
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 To get the count of rows for every 1 ... DB2 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
No new posts Two input files & writing counter... DFSORT/ICETOOL 12
Search our Forums:

Back to Top