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

Reducing the number of Input file reads.


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

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jul 24, 2009 3:32 pm
Reply with quote

I have 5 ICETOOL steps one by one,with the same TOOLIN statement. (Same input and output files)
The include condition varies at
Code:
124,2,CH,EQ,C'XX'.


so the same input file is being read 5 times but with different include steps.
Is it possible to achieve this logic with just one single pass?.

(P.S. The output file is in disp=mod)
Please let me know if any more information is required.


Code:
COUNT FROM(IN1) WRITE(OUT) TEXT('MD ') DIGITS(8) USING(CTL1)

  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
                124,2,CH,EQ,C'01',AND, 
                1,8,CH,EQ,DATE1-1)     


 COUNT FROM(IN1) WRITE(OUT) TEXT('MD ') DIGITS(8) USING(CTL1)

  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
                124,2,CH,EQ,C'02',AND, 
                1,8,CH,EQ,DATE1-1)


 COUNT FROM(IN1) WRITE(OUT) TEXT('MD ') DIGITS(8) USING(CTL1)

  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
                124,2,CH,EQ,C'03',AND, 
                1,8,CH,EQ,DATE1-1)


 COUNT FROM(IN1) WRITE(OUT) TEXT('MD ') DIGITS(8) USING(CTL1)

  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
                124,2,CH,EQ,C'04',AND, 
                1,8,CH,EQ,DATE1-1)

 COUNT FROM(IN1) WRITE(OUT) TEXT('MD ') DIGITS(8) USING(CTL1)

  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
                124,2,CH,EQ,C'05',AND, 
                1,8,CH,EQ,DATE1-1)
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jul 24, 2009 4:21 pm
Reply with quote

I think Frank must be busy today 824.gif . Still no response icon_wink.gif icon_biggrin.gif

Anyways its not urgent.

Thanks & Regards,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 24, 2009 4:26 pm
Reply with quote

Frank is in a different time zone, between 8 - 12 hours behind you.

What exactly are you doing, just getting counts of the number of records that fall into the different include statements.
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Fri Jul 24, 2009 4:32 pm
Reply with quote

Try using the below code. I have never used outfil with count operator.

1) use outfil files along with different include conditions.

Code:
COUNT FROM(IN1) TEXT('MD ') DIGITS(8) USING(CTL1)
COPY FROM(TEMPOUT) TO (OUT) USING

CNTLCTL1
OUTFIL FILES=01,INCLUDE COND=(69,3,CH,EQ,C'SLA',AND,
                124,2,CH,EQ,C'01',AND,
                1,8,CH,EQ,DATE1-1)     
OUTFIL FILES=02,INCLUDE COND=(69,3,CH,EQ,C'SLA',AND,
                124,2,CH,EQ,C'02',AND,
                1,8,CH,EQ,DATE1-1)     
...
...
...


Define DD statements as :
Code:

//SORTOF01 DD DSN=&&T1,
//SORTOF02 DD DSN=&&T2,
...
...
...
//TEMPOUT DD DSN=&&T1,DISP=(OLD,PASS)
                 DD DSN=&&T2,DISP=(OLD,PASS)     
                 DD DSN=&&T3,DISP=(OLD,PASS)     
                 DD DSN=&&T4,DISP=(OLD,PASS)     
                 DD DSN=&&T5,DISP=(OLD,PASS)     


Thanks,
-Kapil.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jul 24, 2009 4:50 pm
Reply with quote

Hi, thanks for your time in this..

Quote:
What exactly are you doing, just getting counts of the number of records that fall into the different include statements


Yes, I just wanted to get the number of records only. For trend monitoring.

Hi Hikaps14,

I would try out your idea with the temp files and let you know if it works. 2014.gif


Regards,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 24, 2009 4:54 pm
Reply with quote

Try this, it will give you a count for each occurrence of a value in the field specified.
Code:

//ICETOOL1 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//INFILE   DD DSN=Your input dataset,DISP=SHR                           
//OUFILE   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
 OCCURS FROM(INFILE) LIST(OUFILE) NOHEADER ON(124,2,CH) ON(VALCNT)
/*                                                               
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Fri Jul 24, 2009 4:57 pm
Reply with quote

Hi vasanthz,

I was trying to achieve the result desired by you, but I guess I messed it up.

I don't think its going to work. Sorry for the confusion.

Frank should be able to clarify our doubts.

Thanks,
-Kapil.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Fri Jul 24, 2009 5:38 pm
Reply with quote

Hi Expat,
Thanks for ur time..

But all the 5 include conditions need to be included and the field (124,2,CH)has many values like SA,AS,GH,01,02,03,04,05,.....


I am looking to get the stats only for 01,02,03,04,05 alone.


Hikaps,
Quote:
I don't think its going to work. Sorry for the confusion.

Thanks for letting me know.


Regards,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Jul 24, 2009 5:54 pm
Reply with quote

This should get it down to two passes of the data, one pass of all data and one pass of the selected data.
But I have NOT tested this code

You could bite the bullet and look through the output from my original post and find only those 5 data types, which should all be grouped together.

Or wait for Frank to finish breakfast and get into the office
Code:

//ICETOOL1 EXEC PGM=ICETOOL                                     
//TOOLMSG  DD SYSOUT=*                                           
//DFSMSG   DD SYSOUT=*                                           
//INFILE   DD DSN=Your input dataset,DISP=SHR                           
//INTEMP   DD DSN=&&whatever,DISP=(,DELETE,DELETE),
//            SPACE=(......),RECFM=xx,LRECL=yyy
//OUFILE   DD SYSOUT=*                                           
//TOOLIN   DD *                                                 
 COPY FROM(INFILE) TO(INTEMP) USING(CTL1)
 OCCURS FROM(INTEMP) LIST(OUFILE) NOHEADER ON(124,2,CH) ON(VALCNT)
/*                                                               
//CTL1CNTL DD *
INCLUDE COND=(69,3,CH,EQ,C'SLA',AND, 
              1,8,CH,EQ,DATE1-1,AND,
              (124,2,CH,EQ,C'01',OR, 
               124,2,CH,EQ,C'02',OR, 
               124,2,CH,EQ,C'03',OR, 
               124,2,CH,EQ,C'04',OR, 
               124,2,CH,EQ,C'05'))
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 24, 2009 9:08 pm
Reply with quote

Vasanth,

If I understand what you want to do, the following one pass DFSORT/ICETOOL job would do it:

Code:

//S1   EXEC  PGM=SORT
//SYSOUT   DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB)
//SORTOUT DD DSN=...  output file (FB/11)
//SYSIN DD *
  OPTION COPY
  INCLUDE COND=(69,3,CH,EQ,C'SLA',AND,
                124,2,SS,EQ,C'01,02,03,04,05',AND,
                1,8,CH,EQ,DATE1-1)
  INREC IFOUTLEN=11,
    IFTHEN=(WHEN=(124,2,CH,EQ,C'01'),BUILD=(1:C'10000')),
    IFTHEN=(WHEN=(124,2,CH,EQ,C'02'),BUILD=(1:C'01000')),
    IFTHEN=(WHEN=(124,2,CH,EQ,C'03'),BUILD=(1:C'00100')),
    IFTHEN=(WHEN=(124,2,CH,EQ,C'04'),BUILD=(1:C'00010')),
    IFTHEN=(WHEN=(124,2,CH,EQ,C'05'),BUILD=(1:C'00001'))
  OUTFIL REMOVECC,NODETAIL,
    TRAILER1=(C'MD ',TOT=(1,1,ZD,TO=ZD,LENGTH=8),/,
              C'MD ',TOT=(2,1,ZD,TO=ZD,LENGTH=8),/,
              C'MD ',TOT=(3,1,ZD,TO=ZD,LENGTH=8),/,
              C'MD ',TOT=(4,1,ZD,TO=ZD,LENGTH=8),/,
              C'MD ',TOT=(5,1,ZD,TO=ZD,LENGTH=8))
/*


Quote:
Posted: Fri Jul 24, 2009 4:21 pm

I think Frank must be busy today . Still no response


Yes, busy sleeping. 4:21pm in India would be 3:30am for me here in California.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 24, 2009 9:10 pm
Reply with quote

Hello,

Quote:
I think Frank must be busy today . Still no response
Suggest that waiting less than an hour before commenting is rather inappropriate and more than just a little inconsiderate. . .

You're quite fortunate you got a reply. . .

GM now recovering from rectal/cranial inversion. . . d
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Jul 25, 2009 1:33 am
Reply with quote

Hi Frank,

Thanks, I will try your solution and let you know.

Hi D,

Quote:
Suggest that waiting less than an hour before commenting is rather inappropriate and more than just a little inconsiderate. . .


I was not chasing for a response, usually Frank responds immediately with a solution in DFSORT topic. No harm intended. icon_keel.gif

Thanks,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Sat Jul 25, 2009 1:47 am
Reply with quote

Quote:
I think Frank must be busy today. Still no response

I guess it was a bad joke. The smileys were there to say I was not serious with that words.

Quote:
Inconsiderate
icon_sad.gif

Regards,
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: Sat Jul 25, 2009 2:42 am
Reply with quote

Quote:
I was not chasing for a response, usually Frank responds immediately with a solution in DFSORT topic. No harm intended.


I only code while sleeping on rare occasions. icon_wink.gif

No harm done.

Dick seems to be getting a little testy lately. icon_sad.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jul 25, 2009 8:18 am
Reply with quote

Hi Vasanth,
Quote:
I guess it was a bad joke. The smileys were there to say I was not serious with that words.
No it was fine, I obviously mis-read - a peril of trying to do multiple things concurrently. . . icon_redface.gif

I do apologize.

Hi Frank,
Quote:
Dick seems to be getting a little testy lately.
Possibly, but not intentionally. Do help keep me straight if i sound too grumpy icon_neutral.gif

d
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jul 27, 2009 3:39 pm
Reply with quote

No problems D. icon_smile.gif

Hi Frank,

The code worked like a charm.. Really cool..

Now I will try understanding what the code actually does, step by step. icon_eyes.gif



Keep it going....
36_8_14.gif



Thanks again,
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Jul 27, 2009 4:04 pm
Reply with quote

Hi,

I amended the program for 11 such variables. i.e(01,02,03,04,05,06,11,14,99)
and here are the results.


Code:
Method   SERV   DISK    CPU (SECS)
1 pass   3258   138     0.12
11 pass  24803  1458    0.81


Thanks for the new logic,
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: Mon Jul 27, 2009 8:48 pm
Reply with quote

You're welcome. Thanks for the feedback.
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: Mon Jul 27, 2009 8:50 pm
Reply with quote

Quote:
Possibly, but not intentionally. Do help keep me straight if i sound too grumpy


We all get grumpy occasionally. You only seem to have a mild case. No big deal.
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top