Is IDCAMS command will be executed unconditionally?



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Is IDCAMS command will be executed unconditionally?

Postby hihui » Wed Jul 30, 2014 9:05 am

Hi guy,
I want to know wheter an IDCAMS command willl always be executed even if its previous command get an error ?

//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=A
//SYSIN DD *
IDCAMS_CMD1 ...
IDCAMS_CMD2 ...
/*

For example, IDCAMS_CMD2 ... will always be executed, whatever the result of its previous command IDCAMS_CMD1, success or failure ?
hihui
 
Posts: 9
Joined: Mon Oct 14, 2013 12:34 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Is IDCAMS command will be executed unconditionally?

 

Re: Is IDCAMS command will be executed unconditionally?

Postby BillyBoyo » Wed Jul 30, 2014 12:01 pm

I suggest that you consult the manual and many examples you can locate with a search engine. If you code it without conditions, it will be unconditional. If you code it with conditions, it will be conditional.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Is IDCAMS command will be executed unconditionally?

Postby hihui » Wed Jul 30, 2014 1:00 pm

BillyBoyo wrote:I suggest that you consult the manual and many examples you can locate with a search engine. If you code it without conditions, it will be unconditional. If you code it with conditions, it will be conditional.


Thanks for you replay; yes I coded it without LASTCC/MAXCC condition.
I had written a simple JCL
//TESTIDCC JOB CLASS=A,MSGCLASS=X,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//*-----------------------------------------------------------------
//STEP01 EXEC PGM=IDCAMS
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
ALLOCATE DATASET('MYID.TEST.DATA1') -
LRECL(80) -
RECFM(V B) -
BLKSIZE(800) -
SPACE(1,1) -
CYL
ALLOCATE DATASET('MYID.TEST.DATA2') -
LRECL(80) -
RECFM(V B) -
BLKSIZE(800) -
SPACE(1,1) -
CYL
/*

When there is a MYID,TEST.DATA1 dataset ,but not MYID.TEST.DATA2; so the first command in the job card will failure, but it seems the second command is executed successfully.
This is different behavior compared with shell script on an unix platform, where a command failure will cause the script to exit immediately, but IDCAMS seems will continue to execute.
so I wish to confirm this, because i couldn't find the explicit statement from IDCAMS manual document.
hihui
 
Posts: 9
Joined: Mon Oct 14, 2013 12:34 pm
Has thanked: 2 times
Been thanked: 0 time

Re: Is IDCAMS command will be executed unconditionally?

Postby enrico-sorichetti » Wed Jul 30, 2014 1:46 pm

This is different behavior compared with shell script on an unix platform,

shell scripting has its rules IDCAMS has others ... nothing more nothing less
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2644
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 130 times

Re: Is IDCAMS command will be executed unconditionally?

Postby BillyBoyo » Wed Jul 30, 2014 2:50 pm

As enrico said, there are rules for IDCAMS and rules for other things. Any intersection of rules need be considered no more than coincidence.

If IDCAMS came to a halt with an operation that got a non-zero value, then there would be no point in IDCAMS having an IF, would there?

You've seen how it operates. Why would you question it? I'm sure it is documented, but I don't see much point in locating the reference.

If you don't want something to run when something else has not given the expected return, then you use IF. It is simple.

The rules which relate to banana skins and apple skins are not the same (how you take them off, whether human-edible). Still, they are fruit. It is something we get over all the time, and no real biggie.

These users thanked the author BillyBoyo for the post:
hihui (Wed Jul 30, 2014 3:35 pm)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post