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
 

 

Regarding search and INCLUDE statement

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

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Mon May 02, 2005 9:50 pm    Post subject: Regarding search and INCLUDE statement
Reply with quote

Hi Frank,

I have a new query, a bit different, i'll try to explain it to you.

1. I have chained three jobs Job1, Job2 and Job3
Job1 is submitted which at the end if the maxcc of Job1 = 0 will submit Job2 and so on. I have set this up and currently it is working fine.

2. Now, in job1 there is a condition as illustrated below:
-----------------------------------------------------------------------------------
=========JOB1========
job1step1
job1step2
job1step3
i am searching for a string '123456' in a dataset JOB1.OUTPUT at this step.
job1submit
If string is found submit the next job that is Job2.
(this is wrking fine currently..no issue here)
=========JOB2========
job2step1
job2step2
job2step3
i am searching for a string '123456' in a dataset JOB2.OUTPUT at this step.
job2submit
If string is found submit the next job that is Job3.
(this is also wrking fine currently..no issue here)
-------------------------------------------------------------------------------------

The Issue:
1. The string '123456' is actually a transaction number which is processed in this chain of three jobs.
2. This can be any 6 digit number. Every time while running this chain that i have made, i have to enter this string in the INCLUDE statement in ICETOOL used for searching in each job.
Like : open the job JOB1 and give the string in its include statement, open job JOB2 and give the same string in the INCLUDE statement and so on for JOB3 also.

The Question:

Is there anyway i can point the INCLUDE statemnt of next job to the INCLUDE statemnt for the first job?
Like : open the job JOB1 and give the string in its include statement, point the INCLUDE statmnt of job2 to that of job1 so that i dun have to repreatedly enter the same string for job2 and job3 ?

Bottomline: Something like the "referback technique"

Please let me know if the doubt is clear,
Thanks in Advance
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 May 02, 2005 10:14 pm    Post subject:
Reply with quote

Here are two suggestions:

1) Put the INCLUDE statement in a RECFM=FB/LRECL=80 data set that all three jobs can use.

If all three sets of control statements are identical, you can put them all in the data set. For example:

Put the control statements in FileA, e.g.

Code:

   OPTION COPY
   INCLUDE COND=(...)


Then use FileA as the control statement data set wherever needed, e.g.

//SYSIN DD DSN=... FileA

If all three sets of control statements are not identical, you can just put the INCLUDE statement in FileA and then use it where needed with concatenation, e.g.

Code:

//SYSIN DD *
   OPTION COPY
//  DD DSN=...  FileA (with INCLUDE statement)


2) If the only thing in your control statements that changes is the INCLUDE constant, set it up as a DFSORT Symbol so you can use it wherever it's needed.

Set up FileA as a RECFM=FB/LRECL=80 data set with:

MYCON,'constant'

Then use:

//SYMNAMES DD DSN=... FileA

in each step and an INCLUDE statement like this:

Code:

   INCLUDE COND=(....,EQ,MYCON)
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Tue May 03, 2005 5:59 pm    Post subject:
Reply with quote

Hi Frank,
I am using the following piece of code for searching a string in the dataset. This piece of code as i previously mentioned is comon in Job2 and Job3:

_________________________________________________________

//*
//SEARCH EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=DEVELOPMENT.OUTPUT.DATA,DISP=SHR
//T1 DD DSN=&&T1,DISP=(NEW,PASS),UNIT=VIO
//TOOLIN DD DATA
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) EMPTY
/*
//CTL1CNTL DD DATA
INCLUDE COND=(1,140,SS,EQ,C'143250')
OUTFIL FNAMES=T1
/*
//*
_________________________________________________________
Currently this is working fine.

As per your first suggestion how do i modify this code. Wch part shud i include in the dataset to be kept comon for both the jobs?

Please let me know.
Thanks in advance,
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: Tue May 03, 2005 9:19 pm    Post subject:
Reply with quote

If all three jobs use the same two control statements for CTL1CNTL, you can create a RECFM=FB/LRECL=80 data set, called MYCTL for example, with:

Code:

  INCLUDE COND=(1,140,SS,EQ,C'143250')
  OUTFIL FNAMES=T1


Then use this in each job:

//CTL1CNTL DD DSN=MYCTL,DISP=SHR

Now you can just change C'143250' in MYCTL to whatever you need when you rerun the jobs.
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Wed May 04, 2005 2:17 pm    Post subject:
Reply with quote

Hi Frank,
As per your suggestion i have created a dataset MYTSO.MYCTL of RECFM=FB/LRECL=80.

=======MYTSO.MYCTL===========
INCLUDE COND=(1,140,SS,EQ,C'143250')
OUTFIL FNAMES=T1
===========================

I used it in the code as follows:
___________________________________
//*
//SEARCH EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=INPUT.DATA,DISP=SHR
//T1 DD DSN=&&T1,DISP=(NEW,PASS),UNIT=VIO
//TOOLIN DD DATA
COPY FROM(IN) USING(CTL1)
COUNT FROM(T1) EMPTY
/*
//CTL1CNTL DD DSN=MYTSO.MYCTL,DISP=SHR
/*
//*
_______________________________________________

But, when i ran the job, this step gave me a return code of 16.
As per my understanding, if the string is not present it shud have given 12, but the string was present in the output dataset.
What can be the reason for 16 return code. Am i missing anything here?

Please let me know.
Thanks in Advance,
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: Wed May 04, 2005 8:46 pm    Post subject:
Reply with quote

The return code 16 is accompanied by an error message (ICExxxA) in //DFSMSG that tells you what you did wrong. If you can't figure out what's wrong from the //DFSMSG messages, post them and I'll help you.

Note that if you actually coded the INCLUDE and OUTFIL statements without a leading blank, then that would be the error - you need to include a leading blank for ALL DFSORT statements.
Back to top
View user's profile Send private message
andycool

New User


Joined: 12 Apr 2005
Posts: 64

PostPosted: Fri May 06, 2005 3:03 pm    Post subject:
Reply with quote

Hi Frank,
Yes, you were right ! I had not given the Leading blank in the statements. I corrected it and the job went fine.

Thanks Again !
Regards,
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 -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
This topic is locked: you cannot edit posts or make replies. How to pass the previous month date i... Suganya87 DFSORT/ICETOOL 5 Mon Oct 31, 2016 4:13 pm
No new posts COBOL DB2 - CALL statement - high CPU... TS70363 DB2 15 Sun Sep 11, 2016 6:07 am
No new posts Converting NULL column into NOT NULL ... Raghu navaikulam DB2 5 Sat Aug 06, 2016 3:45 pm
This topic is locked: you cannot edit posts or make replies. Updating value of key using rewrite s... ParminderKumar COBOL Programming 4 Thu Aug 04, 2016 12:46 am


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