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

ICETOOL higher option


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

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Thu Apr 14, 2016 8:00 am
Reply with quote

This is my first post. I do tried to search the topic i wanted to ask & didn't find exact thing i was looking. Here is my question.

I am using ICETOOL for a file which is having for example 5000 records out of which only 30 records are distinct. Rest all are repetitions. The file is variable length of 4092 & key is starting from 1 byte & 15 in length.

I want a new file to have all records which have repetition more than 139 characters. ICETOOL higher option works only till 99. After it ,gives max cc 0012. I have tried sorkwnn option & dynalloc option as well(which not shown in sample jcl below). None of them worked. So need assistance ...... Thank you in advance!!

Sample JCL used:

//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN= ABC,DISP=SHR
//SORTMH DD DSN=DEF,
// SPACE=(CYL,(150,50),RLSE),DISP=(,CATLG,CATLG),
// DCB=(RECFM=VB,LRECL=4092,BLKSIZE=0)
//TOOLIN DD *
SELECT FROM(IN) TO(SORTMH) ON(5,15,CH) HIGHER(139)
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 14, 2016 11:58 am
Reply with quote

HIGHER is 0-99. End of story.

What do you mean by "have all records which have repetition more than 139 characters". HIGHER does nothing remotely like those words in combination.

You need to be clear about what you want to do, not show random control cards that look like they contain a word related to your task.

If you can tell us what you want, clearly, we can tell you how to do it.
Back to top
View user's profile Send private message
Anshul Das

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Thu Apr 14, 2016 2:27 pm
Reply with quote

"have all records which have repetition more than 139 characters"

Sorry I phrased it wrong .
Here is example what i mean
Input file (First 15 bytes only)
123456789101111
123456789101111
.
.
.
10 times repeated
123456789101112
123456789101112
123456789101112
123456789101112
123456789101112
.
.
.

140 times repeated.

So this record 123456789101112 should be in output file as it qualifies >139 repetitions.

I am not sure if you mean higher option can't work beyond 99. If yes, is there a any other way to get duplicates >139 in a another file.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 14, 2016 2:58 pm
Reply with quote

A COPY operation in a plain SORT step. Extend the record to contain a sequence-number (large enough for your largest possible number of duplicates (and more)), with a RESTART= for the key value (5,15).

Then an OUTFIL with INCLUDE= (or OMIT=) to get the records you want, with a BUILD to return the record to its original content (drop the sequence-number).

Since you have variable-length records you want to extend at the beginning of the data. Lots of examples here.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 14, 2016 4:36 pm
Reply with quote

Obviously not an interview question - moved to DFSort
Back to top
View user's profile Send private message
Anshul Das

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Thu Apr 14, 2016 4:37 pm
Reply with quote

Thank You Bill! Appreciate your response.
Here is the thing ... Original files may contain 10 millions records & i am not sure whether sequence (5,15) will repeat or not next time in input. So ideally file is dynamic.

If i am not wrong Outfil(SORT option) with OMIT will need a sequence, which is not fix here.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Thu Apr 14, 2016 5:05 pm
Reply with quote

Code:

  SORT FIELDS=COPY                               
  INREC  OVERLAY=(4100:SEQNUM,3,ZD,RESTART=(5,15))   
  OUTFIL FNAMES=SORTOUT,INCLUDE(4100,3,ZD,EQ,140),BUILD=(1,4092)   
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 14, 2016 5:22 pm
Reply with quote

Anshul Das,

If you are saying the keys may not be contiguous, then there is no reasonable way to do it (for the size of your file) without SORTing the data.

I have no clue about what you may mean by "dynamic" in that context, so you'll have to clear that up.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Apr 14, 2016 5:23 pm
Reply with quote

kranthikumarb,

That is for fixed-length records. OP has variable-length records.
Back to top
View user's profile Send private message
Anshul Das

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Fri Apr 15, 2016 9:03 am
Reply with quote

Bill, What i mean is this file is a monthly file.....

So Here is sample for
March
123456789101111
.
.
.
20 times
123456789101112
.
.
.
140 times
So here 123456789101112 should be written to sort file.


Next Month File -April
123456789101111
.
.
.
10 times
123456789101113
.
.
.
50 times
123456789101114
.
.
.
.
203 times
123456789101116
.
.
.
150 times


So record 123456789101112 is not present in April month.
Here Sort file should contain 123456789101114 & 123456789101116.
Back to top
View user's profile Send private message
kranthikumarb

Active User


Joined: 02 Jan 2009
Posts: 115
Location: Hyderabad

PostPosted: Fri Apr 15, 2016 11:43 am
Reply with quote

Bill, you are correct. I tried with FB before. How about the below?

Code:

//SORT1    EXEC PGM=ICETOOL                                         
//SEND     DD   DSN=&&SEND,UNIT=SYSDA,SPACE=(CYL,(50,100)),       
//             DISP=(,PASS)                                         
//CATCH    DD   DSN=*.SEND,DISP=(OLD,PASS),VOL=REF=*.SEND           
//TOOLIN   DD   *                                                   
  COPY FROM(SORTIN) TO(SEND) USING(CTL1)                           
  COPY FROM(CATCH) TO(SORTOUT) USING(CTL2)                         
/*                                                                 
//CTL1CNTL DD   *                                                   
  SORT FIELDS=(5,15,CH,A)                                           
/*                                                                 
//CTL2CNTL DD   *                                                   
  INREC  OVERLAY=(4100:SEQNUM,3,ZD,RESTART=(5,15))                 
  OUTFIL FNAMES=SORTOUT,INCLUDE(4100,3,ZD,EQ,140),BUILD(1,4,5,4088)
/*                                                                 
//SYSOUT   DD SYSOUT=*                                             
//SYSPRINT DD SYSOUT=*                                             
//TOOLMSG  DD   SYSOUT=*                                           
//DFSMSG   DD   SYSOUT=*                                           
//SORTIN   DD DISP=SHR,DSN=INPUT.FILE                               
//SORTOUT  DD DISP=SHR,DSN=OUTPUT.FILE                             
Back to top
View user's profile Send private message
Anshul Das

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Fri Apr 15, 2016 2:03 pm
Reply with quote

Thank You very much Kranthi!!
I will try & let you know the result.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Apr 15, 2016 2:13 pm
Reply with quote

kranthikumarb,

I haven't looked at your code (I will) but there is absolutely no need for two passes of the data. No need to use ICETOOL.
Code:

  OPTION COPY
  INREC IFTHEN=(WHEN=INIT,
                 BUILD=(1,4,nX,5)),


Where "n" is the length of the sequence number.

Then after you have used the sequence number field and don't need it any more:
Code:

                 BUILD=(1,4,n+5)


Where "n+5" gives you the location, in the new current record created in the furst BUILD, of the original data.

There's lots of examples of this here.
Back to top
View user's profile Send private message
Anshul Das

New User


Joined: 10 Jan 2009
Posts: 6
Location: pune

PostPosted: Tue Jun 07, 2016 7:49 am
Reply with quote

Hello, updating late.
Kranthi , your sort card has worked perfectly well. Thanks for help!
Initially it was confusing ..but i went through some of some manuals & i was able to get what this CTL2 was doing.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jun 07, 2016 10:08 am
Reply with quote

Ansul,

Maybe you'd like to post your control cards, just in case?
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 SCOPE PENDING option -check data DB2 2
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts OUTFIL with SAVE option DFSORT/ICETOOL 7
Search our Forums:

Back to Top