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
 

 

setting maxcc conditionally in jcl

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 132
Location: India

PostPosted: Thu Nov 18, 2010 11:25 am    Post subject: setting maxcc conditionally in jcl
Reply with quote

Hi ,

I have requirement as follows,In an input file there will be only one record(FB file) of four characters, I need to check each character and I need to set maxcc based on it’s value. This should be done in JCL either preferably within 2 steps. please let me know if there is any feasibility for achieving this. Thanks in advance for your co-operation.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 18, 2010 12:52 pm    Post subject:
Reply with quote

I for one am totally lost on exactly what it is that you want to achieve.

And as for doing it in JCL, you have been on this forum long enough to know the stupidity of that statement. Surely by now you have learnt that JCL only executes programs, so which program do you want to execute.

You say that you check each 4 characters and set the maxcc (I am sure that you really do mean to use the correct terminology of RETURN CODE) accordingly.

OK, so today is not psychic day, how about giving out some useful information that might help people understand and resolve your problem.

And what the hell has this got to do with VSAM ???
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 18, 2010 7:23 pm    Post subject: Re: setting maxcc conditionally in jcl
Reply with quote

GaganGarg wrote:
I have requirement as follows,In an input file there will be only one record(FB file) of four characters, I need to check each character and I need to set maxcc based on it’s value. This should be done in JCL either preferably within 2 steps. please let me know if there is any feasibility for achieving this. Thanks in advance for your co-operation.
Write a COBOL program - READ the file, use reference modification and tally the read-character and move the appropriate value to RETURN-CODE special register. Execute this program in Your JCL.

If you are looking for executing some utility using JCL, for instance if it is SORT - search for NULLOUT.
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 132
Location: India

PostPosted: Thu Nov 18, 2010 7:30 pm    Post subject:
Reply with quote

Thanks Anuj,

I have used the following JCL:

Code:


//STEP1    EXEC PGM=SORT,PARM='NULLOUT=RC16'
//SYSOUT   DD SYSOUT=*                     
//SORTIN   DD *                           
0000                                 
//SORTOUT  DD SYSOUT=*                     
//SYSIN    DD *                           
 OPTION COPY                               
 INCLUDE COND=(1,1,CH,EQ,C'1')



Likewise, I can Check any number of columns in the JCL. Thanks for the Hint.icon_smile.gif

Expat,

Sorry for not putting the requirement clearly. Here it is:

I wanted to check the First four columns of a PS file which is having only one record.

If First column is having value '1', Then I need to execute a PROC1 otherwise not.

If 2nd column is having value '1', Then I need to execute a PROC2 otherwise not. And, So on.

So i will be having four steps in the Job, one step for each column value from 1-4 and four conditionally executed procs.


Thanks!
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Nov 18, 2010 7:33 pm    Post subject: Reply to: setting maxcc conditionally in jcl
Reply with quote

just being picky ...
what if all four columns contain a 1 ?

wouldn' t an appropriate scheduler setup satisfy better the OVERALL requirement ?
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 132
Location: India

PostPosted: Thu Nov 18, 2010 7:35 pm    Post subject:
Reply with quote

All four Procs will be executed.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 18, 2010 7:39 pm    Post subject:
Reply with quote

Why do you use "INCLUDE COND" - if just RC (?? - please read again what expat has said) is your concern, use :
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//SORTOUT DD DUMMY
//SYSIN DD *
  OPTION COPY,NULLOUT=RC4
  OMIT COND=(1,80,S,EQ,C'T')
/*
Also, if all the four characters are different, use "SS" instead of "CH", that way position of the character will not be a constraint -- just my thought.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Thu Nov 18, 2010 7:42 pm    Post subject: Reply to: setting maxcc conditionally in jcl
Reply with quote

then a single return code would not be enough !
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Nov 18, 2010 7:46 pm    Post subject:
Reply with quote

This is pseudo code...

Step1 check col1
Step2 check col2
Step3 check col3
Step4 check col4

Later...
IF STEP1.RC = 0 THEN
CALL PROC1
ENDIF

IF STEP2.RC = 0 THEN
CALL PROC2
ENDIF

ETC...

I am betting the next question will be....
Can this be done in one step? That is the requirement.

My answer is: I do not know or care.
Those four steps will run in a total of 0.04 CPU time or less.

While a more elegant solution may be possible the end result will be the same.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Nov 18, 2010 7:48 pm    Post subject:
Reply with quote

Enrico, I beg to differ

If the four byte file was read into REXX, then that in itself could be used to set the RC.

I assume here that the values of said 4 bytes would be only 0 or 1

Read the file in, set the RC to the value of the parse variable, and then execute conditionally using IF/THEN/ELSE/END statements.

YES, I know, convoluted and fussy, but hey, it will work
Back to top
View user's profile Send private message
GaganGarg

Active User


Joined: 31 Mar 2010
Posts: 132
Location: India

PostPosted: Thu Nov 18, 2010 7:50 pm    Post subject:
Reply with quote

Thanks Anuj for your reply.

Actually the thing is, In my project, Four jobs are running in parallel.

Say Job a, Job b, Job c and Job d

So four files are coming from there four jobs:

File a, File b, File c, File d.

And at the end of each job we are Overlaying a record in the same PS file.

First byte: 1 for Failure and 0 for Successful run of the job a
2nd byte: 1for Failure and 0 for Successful run of the job b
and so on.

At the end of these jobs, we need to merge the files File a, File b, File c and File d in another job Job E.

Now suppose one of the job fails say Job a, Then the O/p file File 'a' of Job 'a' may or may not have Valid and full data. So we want to empty this file before doing the merging.

For this purpose, we will be checking the First byte (through four) of The PS file. If it 1 then we will call a proc1(through 4) will empty FIle 'a'. otherwise PROC1 will not be executed.

I hope now It is clear.
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 645
Location: Pennsylvania

PostPosted: Thu Nov 18, 2010 8:02 pm    Post subject:
Reply with quote

Now more information comes to light icon_cry.gif

If it were me, this is what I would do.

In each of the four Jobs, since you know if it worked or not (you overlay the 0 or 1), code this at the end of the Job (pseudo code):
IF Success
Write MY.OUTPUT.DATA TO MY.OUTPUT.DATA.FINAL (using sort or idcams)
ELSE
Write EMPTY.FILE TO MY.OUTPUT.DATA.FINAL (or just create it as new)
ENDIF

Then use the four FINAL files as input into your merge.

This is yet another example incomplete initial explainations wasting the time of those willing to help.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Nov 18, 2010 8:14 pm    Post subject:
Reply with quote

Gagan- you 100th post, actually, changes everything about this thread. I'll go with what daveporcelan has suggested - that's the neat solution. I too had posted the similar solution but it would have been a repetition, so I've deleted that.

By the way, are you executing some COBOL-program/utility in some step and using COND=ONLY in for that, to append 0/1 to the file -- if so, why not execute a dummy IEFBR14 step to create an empty file in that step itslef?
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Thu Nov 18, 2010 10:27 pm    Post subject:
Reply with quote

Hello,

Another way to do this is to set the condition code using "powers of 2". . .

When processing the 4 "switches" accumulate the value for the return-code rather than only "moving" to it (use a WS variable and when done move it to return-cide). If the first switsh is set - add 1, if the second is set - add 2, the third - add 4, and the 4th - add 8. If the input value was 0101, the return code would be 10.

Then test the return code in the jcl to determine which step(s) to execute. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Nov 19, 2010 4:47 pm    Post subject:
Reply with quote

Topic locked, per the request by OP.

Thanks,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts XFACILIT class setting for Fault Anal... egrove IBM Tools 2 Thu Aug 11, 2016 8:02 pm
No new posts To split the record conditionally Lakshmi Prakash DFSORT/ICETOOL 4 Mon Feb 22, 2016 7:52 pm
No new posts CALL MACRO EXECUTE FORM - Setting the... sudarshan.srivathsav PL/I & Assembler 7 Tue Feb 09, 2016 10:32 pm
No new posts Setting up a new trigger krisprems DB2 4 Thu Dec 24, 2015 10:33 pm
No new posts character setting configuration into ... sakthikumarT DB2 5 Thu Nov 05, 2015 11:37 am


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