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
 

 

Icetool featuring the splice option

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

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Thu Aug 17, 2006 4:05 pm    Post subject: Icetool featuring the splice option
Reply with quote

Dear Frank,

I am fairly new in using ICETOOL, so I sure will appreciate your
expert opinion and help with a problem I have...

I have 2 input files...

The fist file is a report on jobnames and the abend code...e.g.

Code:

----+----1----+----2----+----3----+----4----+----
********************************* Top of Data ***
CMDOFES1    FLUSH  SERVICES                   
NQMOPROF    U3400  SOLUTIONS                 
******************************** Bottom of Data *


The second input file will look like this....

Code:

----+----1----+----2----+----3----+----4----+
********************************* Top of Data
AC    THIBB     BAAQ         DIST (CORPORATE)
AD    THIBB     BAAQ         DIST (DATED)
AF    THIBB     BAAQ         DIST (5 DAY)
NQ    CFDS1     BAAEE        PNS
AO    THIBB     BAAQ         DIST (1 DAY)
AP    THIBC     THIB         ACCOUNTS PAYABLE
CM    THIBC     THGC1        CREDIT MANAGEMENT


Now Frank, I need is to match the first two characters of the jobsnames
in the frst input file, with the first two characters in the second input file.
The first two characters represent the first two characters of a jobname
for all the different applications.
Untimately, like in te exanple above, there should be two matches
and it should look something like this at the end of the day...

Code:

CMDOFES1    FLUSH  SERVICES  THIBC     THGC1        CREDIT MANAGEMENT
NQMOPROF    U3400  SOLUTIONS CFDS1     BAAEE        PNS


All I need is to match the jobs the first two characters of the second input file, and then write the info from the second file right next to
the info from the first input file.

Hope it makes sence, and hope to hear from you soon!

Kind regards,
Martin
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 Aug 17, 2006 8:31 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, and I'm not sure I got the starting positions of all the input and output fields right, but this should give you the idea and you can change the job appropriately if necessary.

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,2,CH) -
  WITHALL WITH(1,29)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,2,30:7,40,80:X)
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,29,80:X)
/*
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Fri Aug 18, 2006 10:47 am    Post subject: Re: Icetool featuring the splice option
Reply with quote

Hello Frank,

Thank you for your help. The output is not right, but at least I can
sit down and try to puzzle thins thing out. If I do not get it right
I will ask for your help again. icon_lol.gif

Thanx again.
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Fri Aug 18, 2006 6:20 pm    Post subject: Re: Icetool featuring the splice option
Reply with quote

Hi Frank,

I hope you can assist me here.

This is currently what the JCL looks like:
Code:

//IN1 DD DSN=PSCHD.WMSTR.REPORT.COMP.SOLU.SERV.FNL.AUG16A,DISP=SHR   
//IN2 DD DSN=PSCHD.PCNTL.STATS.APPL.CODES,DISP=SHR                   
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)       
//OUT DD DSN=COPR.ABMF043.PAD.TEST.SPLICE.REPORT,                   
//           DISP=(NEW,CATLG,DELETE),                               
//           SPACE=(TRK,(100,500),RLSE),                             
//           RECFM=FB,LRECL=80                                       
//TOOLIN DD *                                                       
COPY FROM(IN2) TO(T1) USING(CTL1)                                   
COPY FROM(IN1) TO(T1) USING(CTL2)                                   
SPLICE FROM(T1) TO(OUT) ON(1,2,CH) -                                 
  WITHALL WITH(1,29)                                                 
/*                                                                   
//CTL1CNTL DD *                                                     
  OUTREC FIELDS=(1,2,30:7,40,80:X)                                   
/*                                                                   
//CTL2CNTL DD *                                                     
  OUTREC FIELDS=(1,29,80:X)                                         
/*                                               


IN1 file:
Code:

----+----1----+----2----+----3----+----4----+--
********************************* Top of Data *
SVDOMUPA    FLUSH  SERVICES
CMDOFES1    FLUSH  SERVICES                   
CMDOFES2    FLUSH  SERVICES                   
NQMOPROF    U3400  SOLUTIONS                   



IN2 file:
Code:

----+----1----+----2----+----3----+----4----+----5-
***************************** Top of Data *********
AZ    THIBC     CFDS1        PURE EXTRACTS         
BC    THIBB     BAAE         INTERNET             
CM    THIBA     BAAH         CREDIT MANAGEMENT     
NQ    THIBA     BAA          PRODUCT NOTIFICATION 
NS    THIBC     THGC1        DBA DEPARTMENT       
OCDJ  THIBC     BAAH         BANKFIN OCS           
OCDO  THIBA     BAAH         ONLINE COLLECTIONS   
OCMJ  THIBC     BAAH         BANKFIN OCS           
SV    THIBB     BAAE         SAVINGS             


I get the following output:
Code:


********************************* Top of Data *************************
CMDOFES2    FLUSH  SERVICES  THIBA     BAAH   CREDIT MANAGEMENT 
NQMOPROF    U3400  SOLUTIONS THIBA     BAA    PRODUCT NOTIFICAT 
OC                                             THIBC     BAAH  BANKFIN OCS       
SVDOMUPA    FLUSH  SERVICES  THIBB     BAAE   SAVINGS


Well this is already a much better but I still have one problem.
From IN1, if I have more than one CM* job that abended, it will only
take CMDOFES2, and discard CMDORES1.
I need both on the report with the decriptions next to it to say
it is a credit maagement product.

My IN2 file also have some duplicates on the first field and it is also displayed in the output file, but that I can take out with a sort if needed.

Thanks for your help, hope to hear from you soon.

Regards,
Martin.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Aug 18, 2006 6:29 pm    Post subject: Re: Icetool featuring the splice option
Reply with quote

Martin, please include the [code] BBCode tags around your code and data examples. It really helps readability.
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 Aug 18, 2006 10:27 pm    Post subject:
Reply with quote

Martin,

When I run the job you show with DFSORT using the input files you show, I get different output than you do. I get:

Code:

CMDOFES1    FLUSH  SERVICES  THIBA     BAAH         CREDIT MANAGEMENT   
CMDOFES2    FLUSH  SERVICES  THIBA     BAAH         CREDIT MANAGEMENT   
NQMOPROF    U3400  SOLUTIONS THIBA     BAA          PRODUCT NOTIFICAT   
OC                           THIBC     BAAH         BANKFIN OCS         
OC                           THIBC     BAAH         BANKFIN OCS         
SVDOMUPA    FLUSH  SERVICES  THIBB     BAAE         SAVINGS             


Notice that both CMDOFES records are shown as would be expected since I used WITHALL to handle that. I don't know why you aren't getting the first CMDOFES record. Are you sure you're actually using the job and input files you show? Are you using DFSORT (ICE messages) or another sort product?

Your first example did NOT have dups in file2 so I didn't code for that. That's easily handled by doing a SELECT ... FIRST on file2 to ensure there are no dups. I can show you how to do that, but first you need to figure out why you're not getting both CMDOFES records when I am.
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Mon Aug 21, 2006 10:18 am    Post subject:
Reply with quote

Hi Frank,

Ok I finally got all the CMDOFES records to show, thank you
very much for you help so far. icon_biggrin.gif
How do you do the select on the second file to get rid of the
duplicate records in there?

Kind regards,
Martin
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: Mon Aug 21, 2006 8:28 pm    Post subject:
Reply with quote

Here's a DFSORT/ICETOOL job that will take care of the duplicates in file2:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,2,CH) -
  WITHALL WITH(1,29) WITH(81,1) USING(CTL3)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(1,2,30:7,40,81:C'BB')
/*
//CTL2CNTL DD *
  OUTREC FIELDS=(1,29,81:C'VV')
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'VB'),
    OUTREC=(1,80)
/*
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Tue Aug 22, 2006 3:50 pm    Post subject:
Reply with quote

Hello Frank, the stuff is working perfectly fine.
Thanx for all your help. icon_cool.gif
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Thu Aug 24, 2006 11:04 am    Post subject:
Reply with quote

Hi Frank,

Just one question again regarding this whole process we set up...
I have in my input two file a couple of duplicates
that I can not actually take out because the jobname
(first four bytes) each have a different standby group
(field 7-11). What happens now is that it keeps the first record
of the duplicates, and now send out the report with sometimes
the incorrect info (wrong standby group).

What suggestions do you have to get around this problem without changing too much in the current process?

Regards,
Martin
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 Aug 24, 2006 9:14 pm    Post subject:
Reply with quote

Is this jobname a particular string or does it vary from run to run? Please show me an example of the input and expected output.
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Fri Aug 25, 2006 12:15 pm    Post subject:
Reply with quote

Hi Frank,

The job names are set up like this:

CIDB***
CIDJ***
CIDO***
CIMB***
CIMJ***
CIMO***
CIWB***
CIWJ***
CIWO***

The first two charaters CI = Client information
The third character will indicate if it is a daily monthly or weekly job
The fourth character will either be B, J, or O...was set up like
this because I receive these stats from more than one system.
The **** can be any alfa numeric value to be used as a job identifier.

Typical input file (IN1) will look like this...

----+----1----+----2----+----3----+----4-
***************************** Top of Data
CIDB1234 00012 SERVICES
CIDJ5678 U0222 SOLUTIONS
CIDO0102 U3400 SOLUTIONS
OCDO001A U1008 SOLUTIONS

Second input file (IN2) will look like this....it is actually
more than 300 records long but here is the part that
I will need to cater for...

----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
CD THIBC BAAN BANKFIN CDS
CF THIBA BAAR CASH FOCUS
CIDB THIBA BAAJ CIF
CIDJ THIBC BAAJ BANKFIN CIF
CIDO THIBA BAAJ CIF
CIMB THIBA BAAJ CIF
CIMJ THIBC BAAJ BANKFIN CIF
CIMO THIBA BAAJ CIF
CIWB THIBA BAAJ CIF
CIWJ THIBC BAAJ BANKFIN CIF
CIWO THIBA BAAJ CIF
CK THIBA BAAX CREDIT LIFE
OC THIBA BAAR ONLINE COLLECT

The expected should then read like follows:

----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
***************************** Top of Data *****************************
CIDB1234 00012 SERVICES THIBA BAAJ CIF
CIDJ5678 U0222 SOLUTIONS THIBC BAAJ BANKFIN CIF
CIDO0102 U3400 SOLUTIONS THIBA BAAJ CIF
OCDO001A U1008 SOLUTIONS THIBA BAAR ONLINE COLLECT

The problem comes in where we splice the first two characters.
As mentioned above, in field four of the job name the charaters
will either be B, J or O.
Group THIBA will always be reponsible for B and O, and group
THIBC for J.

Will you please assist me in this problem?

Kind regards,
Martin
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Fri Aug 25, 2006 12:50 pm    Post subject:
Reply with quote

Sorry Frank, if you need to know, the LRECL of all files are 80
and the RECFM=FB
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 Aug 25, 2006 7:47 pm    Post subject:
Reply with quote

Are you saying that if the first two characters are CI, you want to match on the first four characters, but otherwise you want to match on the first two characters?
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Sat Aug 26, 2006 1:08 am    Post subject: Re: Icetool featuring the splice option
Reply with quote

Hi Frank, yes if we can do that it will definately work.
In future I can then use the same statement if needed
because we do add alot of new products on a quaterly basis.

Cheers,
Martin
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 Aug 26, 2006 1:52 am    Post subject:
Reply with quote

Martin,

Here's a revised DFSORT/ICETOOL job that will meet your new requirement:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/80)
//TOOLIN DD *
COPY FROM(IN2) TO(T1) USING(CTL1)
COPY FROM(IN1) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(83,4,CH) -
  WITHALL WITH(1,29) WITH(81,1) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
          BUILD=(1,4,30:7,40,81:C'BB',83:1,2,2X)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'CI'),
          OVERLAY=(83:1,4))
/*
//CTL2CNTL DD *
  INREC IFTHEN=(WHEN=INIT,
          BUILD=(1,29,81:C'VV',83:1,2,2X)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'CI'),
          OVERLAY=(83:1,4))
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'VB'),
    OUTREC=(1,80)
/*
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Sat Aug 26, 2006 3:07 pm    Post subject:
Reply with quote

Frank,

Thank you very much. I will try it on Monday and let you
know if all went well.

Cheers,
Martin
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Mon Aug 28, 2006 10:20 am    Post subject:
Reply with quote

Hello Frank,

The JCL is working perfectly fine thank you very much.
If I do however encounter a similar situation with a different
jobname can I just repeat the following statement
with the correct jobname? I have replaced the CI jobs with **...

IFTHEN=(WHEN=(1,2,CH,EQ,C'**'),
OVERLAY=(83:1,4))

Cheers,
Martin
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: Mon Aug 28, 2006 8:52 pm    Post subject:
Reply with quote

Yes, but you need a comma at the end of all but the last IFTHEN clause, e.g.

Code:

  INREC IFTHEN=(WHEN=INIT,
          BUILD=(1,29,81:C'VV',83:1,2,2X)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'CI'),
          OVERLAY=(83:1,4)),
        IFTHEN=(WHEN=(1,2,CH,EQ,C'**'),
          OVERLAY=(83:1,4))


Actually, an easier way to do it is like this:

Code:

  INREC IFTHEN=(WHEN=INIT,
          BUILD=(1,29,81:C'VV',83:1,2,2X)),
        IFTHEN=(WHEN=(1,2,SS,EQ,C'CI,**'),
          OVERLAY=(83:1,4))


You can add more 2-byte literals within the C'...' for SS, e.g.

WHEN=(1,2,SS,EQ,C'CI,**,s1,s2,...')
Back to top
View user's profile Send private message
martin Fourie

New User


Joined: 17 Aug 2006
Posts: 13
Location: JHB, South Africa

PostPosted: Thu Aug 31, 2006 1:30 am    Post subject:
Reply with quote

Frank thank you for all the help.
It is much appreciated.

Regards,
Martin
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 BWO option in VSAM blayek CICS 3 Sat Nov 05, 2016 10:47 am
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
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 ICETOOL/SYNCSORT - SYSPRINT output nartcr DFSORT/ICETOOL 17 Wed Oct 05, 2016 10:46 pm
No new posts Icetool or Joinkeys example to compar... ishant chauhan DFSORT/ICETOOL 21 Sat Aug 20, 2016 2:40 am


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