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

Query regarding comparision using ICETOOL.


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

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Wed May 30, 2007 2:15 pm
Reply with quote

Hi,
I have one querry regarding comparision using ICETOOL.
There are 2 files(fileA and fileB), need to compare it.
There is a field run-date in both the files. While comparing, if the record of fileA is not present in fileB and if the run-date is less than 21 days then only, we need to move this record to fileC.

Raj
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed May 30, 2007 2:24 pm
Reply with quote

Raj,

Could you provide the rundate format (yyyymmdd etc...)?
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Wed May 30, 2007 2:31 pm
Reply with quote

Murali,
it is yyyy-mm-dd
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed May 30, 2007 2:49 pm
Reply with quote

Raj,

Download sorttrck.pdf from the following link -

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

The topic Create files with matching and non-matching records gives the records which are available in fileA only. In the next step run the above OP file against the following sort card -

Assumptions -

Your run date is between 1-10 columns.
LRECL=80; RECFM=FB

Code:
//SYSIN DD *
* put yyyy-mm-dd as yyyymmdd @ 81 col temp
  INREC OVERLAY=(81:1,4,   * YYYY
                6,2,   *MM
                9,2)   *DD
  SORT FIELDS=COPY
  INCLUDE COND=(81,8,CH,GT,DATE2-21)
  OUTREC BUILD=(1,80)
/*
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 May 30, 2007 7:51 pm
Reply with quote

Raj,

If you want a more specific solution:

Please give an example of the records in each input file and what you expect for output.

Please give the RECFM and LRECL of each input file.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Wed May 30, 2007 8:25 pm
Reply with quote

Murali,
Thanks a lot
I am modifying my JCL to the requirement. Once I complete I will let you know.

Raj
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 12:19 pm
Reply with quote

Hi Murali,
Here I am sending you the the, Kindly look into this and tell me how to modify.

Code:

//ICE001 EXEC PGM=ICETOOL
//*
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//ICEIN01 DD DSN=***************
//ICEIN02 DD DSN=****************
//TEMP01  DD DSN=&TEMP01,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//TEMP02  DD DSN=&TEMP02,SPACE=(CYL,(5,5),RLSE),DISP=(,PASS)
//INTR    DD DSN=*.TEMP01,DISP=(OLD,PASS),VOL=REF=*.TEMP01
//        DD DSN=*.TEMP02,DISP=(OLD,PASS),VOL=REF=*.TEMP02
//FILEA   DD DSN=*******************
//FILEB   DD DSN=*******************
//OUT     DD DSN=*******************
//TOOLIN  DD *
  SORT FROM(ICEIN01) USING(CTL1)
  SORT FROM(ICEIN02) USING(CTL2)
  SORT FROM(INTR) USING(CTL3)
//CTL1CNTL DD *
    SORT FIELDS=(1,21,CH,A)
    OUTFIL FNAMES=TEMP01,OUTREC=(1,107,C'1')
//CTL2CNTL DD *
    SORT FIELDS=(1,21,CH,A)
    OUTFIL FNAMES=TEMP02,OUTREC=(1,107,C'2')
//CTL3CNTL DD *
    SORT FIELDS=(1,21,CH,A)
    SUM FIELDS=(108,1,ZD)
    OUTFIL FNAMES=OUT,INCLUDE=(108,1,ZD,EQ,3),OUTREC=(1,107)
    OUTFIL FNAMES=FILEA,INCLUDE=(108,1,CH,EQ,C'1'),OUTREC=(1,107)
    OUTFIL FNAMES=FILEB,INCLUDE=(108,1,CH,EQ,C'2'),OUTREC=(1,107)
/*
//*
//

Now my requirementis,
There is a field Run-date(yyyy-mm-dd) in both the files ICEIN01 and ICEIN02. Now my requirementis a record found in both the files it
should have to write in file OUT. If the record of file ICEIN01,not present in file ICEIN02 and Run-date is less than 21days,
those records I need to write into file A, and the records present only in ICEIN02 has to write in file B.
The above code is doing the same thing except the run-date part. It is not taking into account the run-date.
Murali, can you please tell me how to modify this?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 12:34 pm
Reply with quote

Raj,

The above step extract all the records into 3 files (irrespective whether the run date falls with the 21 day range or not).

Quote:
It is not taking into account the run-date


Add the following step after ICE001 step.

Code:

//STEP2 EXEC PGM=SORT
//SORTIN DD DSN=FILEA from ICE001 step goes here
//SORTOUT DD DSN=......
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
   COPY THE CONTROL CARD PROVIDED IN MY EARLIER POST WITH REQ CHANGES
/*


Hope this solves your problem.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 2:18 pm
Reply with quote

Murali, I am getting the following error, while submiting the sort card

Code:

//S2 EXEC PGM=SORT
//SORTIN DD DSN=FILEA
//SORTOUT DD DSN=====
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
  INREC OVERLAY=(108:1,4,   *YYYY
                 6,2,       *MM
                 9,2)       *DD
  SORT FIELDS=COPY
  INCLUDE COND=(108,8,CH,GT,DATE2-21)
  OUTREC BUILD=(1,107)


Error what I am getting is

Code:

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 2:26 pm
Reply with quote

Raj,

Please post the complete error messages.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 2:34 pm
Reply with quote

This is the only error I am getting

Code:

ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1     
ICE027A 2 END OF          FIELD BEYOND MAXIMUM RECORD LENGTH
ICE751I 0 C5-K90007 C6-K90007 C7-K90000 C8-K90007 E7-K11698
ICE052I 3 END OF DFSORT                                     


Raj
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 3:04 pm
Reply with quote

Bhoja,

Im very sorry. I got confused with the sort processing. Try this -

Code:
//STEP2 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//FILEA DD DSN=FILEA
//TEMPFILE DD DSN=TEMP.FILE,DISP=(MOD,CATLG,CATLG),
//        LRECL=115,RECFM=FB,............
//OUTFILE DD DSN=YOUR.OPFILE,.....
//SYSIN DD *
  COPY FROM(FILEA) TO(TEMPFILE) USING(FRST)
  COPY FROM(TEMPFILE) USING(SECD)
/*
//FRSTCNTL DD *
  INREC OVERLAY==(108:1,4, *YYYY
                                6,2, *MM
                                9,2) *DD
/*
//SECDCNTL DD *
   OUTFIL FNAMES=OUTFILE,
   INCLUDE=(108,8,CH,GT,DATE2-21),
   BUILD=(1,107)
/*
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 3:29 pm
Reply with quote

Thank a lot. I will try this

Raj
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 5:39 pm
Reply with quote

Hi Murali,
The above code is giving simply RC 20, not throwing any error and not getting the output

Raj
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 5:52 pm
Reply with quote

Please post your spool messages.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Thu May 31, 2007 6:03 pm
Reply with quote

This is the only message I am getting
IEF142I YD27DN0 ICE002 - STEP WAS EXECUTED - COND CODE 0020
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu May 31, 2007 6:12 pm
Reply with quote

In the sysout of step ICE002, you will get some messages (your control card etc...). Provide post those.
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: Thu May 31, 2007 9:01 pm
Reply with quote

Quote:
If you want a more specific solution:

Please give an example of the records in each input file and what you expect for output.

Please give the RECFM and LRECL of each input file.


Bhoja,

Well, I offered to help, but I guess you weren't interested in my offer.

As to the reason why you're getting RC=20, it's because Murali mixed up DFSORT and ICETOOL JCL. He has:

Code:

//STEP2 EXEC PGM=ICETOOL
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//FILEA DD DSN=FILEA
//TEMPFILE DD DSN=TEMP.FILE,DISP=(MOD,CATLG,CATLG),
//        LRECL=115,RECFM=FB,............
//OUTFILE DD DSN=YOUR.OPFILE,.....
//SYSIN DD *


It should be:

Code:

//STEP2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEA DD DSN=FILEA
//TEMPFILE DD DSN=TEMP.FILE,DISP=(MOD,CATLG,CATLG),
//        LRECL=115,RECFM=FB,............
//OUTFILE DD DSN=YOUR.OPFILE,.....
//TOOLIN DD *


If you want to continue to work with Murali, feel free. If you want my help, supply the information I asked for.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Fri Jun 01, 2007 11:45 am
Reply with quote

Hi,
I tried with TOOLIN DD * also, still I am getting the same RC 20 without showing any error message.

Raj
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 Jun 01, 2007 10:27 pm
Reply with quote

Sigh. Look at my post again. You also have to change:

//SYSOUT DD SYSOUT=*

to

//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Mon Jun 04, 2007 12:16 pm
Reply with quote

Hi,
Now I am getting the error message ICE201I E RECORD TYPE IS F - DATA STARTS IN POSITION 1
RC 16.

Raj
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 Jun 04, 2007 8:40 pm
Reply with quote

ICE201I is NOT an error message. It's an informational message. An error message would be in the form ICExxxA.
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Tue Jun 05, 2007 11:53 am
Reply with quote

Yes Frank,
The error what I am getting is ICE007A 1 SYNTAX ERROR
while executing the toolin dd * statement

Raj
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 Jun 05, 2007 8:19 pm
Reply with quote

Sigh. ICE007A is a DFSORT message, not an ICETOOL message, so if you're getting it for a statement in TOOLIN, you are still mixing up DFSORT and ICETOOL JCL.

What Murali gave you had mixed up JCL. What you changed it to appears to still have mixed up JCL. In order to tell you why you're getting the ICE007A, I'd need to see all of your JCL and control statements.

But I don't even know if the job Murali gave you, when corrected, will do what you want since you ignored (twice) what I said about what I really needed to help you:

Quote:
If you want a more specific solution:

Please give an example of the records in each input file and what you expect for output.

Please give the RECFM and LRECL of each input file.


It would be best to just give me that information so we can start over rather than try to "fix" your job which may not do what you want anyway.
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 RC query -Time column CA Products 3
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 Dynamically pass table name to a sele... DB2 2
Search our Forums:

Back to Top