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

Conditional JCL


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

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Thu May 31, 2012 10:50 pm
Reply with quote

Does DFSORT pass anything (return code for example) when no records are selected that i can use in conditional jcl to bypass a block of jcl ? If no records are created in my output file i don't want to email the output file.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu May 31, 2012 10:59 pm
Reply with quote

Please check here

Also how is your input file created so that if nothing is written cant you set the return code there ( Just to check if you create your input using any program apart from sort )
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Thu May 31, 2012 11:11 pm
Reply with quote

And also refer to NULLOFL and NULLOUT

NULLOUT applies to the SORTOUT data set. NULLOFL applies to OUTFIL data sets

Thanks,
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Thu May 31, 2012 11:40 pm
Reply with quote

thanks alot, this works for me..
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Fri Jun 01, 2012 6:21 pm
Reply with quote

it sets the return code fine (CC=04) ... but i get a jcl error (invalid referback) on the IF statement.

I have tried the following IF statements
IF SORT.RC = 0 then
IF STEP1. RC = 0 then


//STEP1 EXEC SORT
//SORTIN DD DSN=TEMP.JRH.MANUAL,DISP=(SHR)
//SORTOF1 DD DSN=&&CHEPEML,DISP=(NEW,PASS)
//SYMNAMES DD DSN=CTLCDS.DUDA(SYMNAMES),DISP=SHR
//SYSIN DD DISP=SHR,DSN=CTLCDS.DUDA(ODSA29)
// IF SORT.RC = 0 THEN
//MAILIT EXEC MAILREPT
//MFMAIL.REPORT DD DSN=&&CHEPEML,DISP=(OLD,DELETE)
//MFMAIL.SYSTSIN DD *
%XMITIP (JRH@DUDA.COM) NOMSG FILEDD REPORT -
SUBJECT 'CHEP PALLETS FOR REVERSAL' -
MSGT 'SEE ATTACHMENT FOR REPORT'
// ENDIF
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jun 01, 2012 6:29 pm
Reply with quote

why two if and one end if?
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Fri Jun 01, 2012 6:37 pm
Reply with quote

only one IF in the jcl example... those are the 2 different IFs that i have tried and received the same error.
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Fri Jun 01, 2012 6:39 pm
Reply with quote

Could you show us the JESYSMSG from your SPOOL?

Thanks.
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Fri Jun 01, 2012 6:43 pm
Reply with quote

STMT NO. MESSAGE
2 IEFC001I PROCEDURE SORT WAS EXPANDED USING SYSTEM LIBRARY OD.PROD.PROC
10 IEFC001I PROCEDURE MAILREPT WAS EXPANDED USING SYSTEM LIBRARY OD.PROD.
9 IEF645I INVALID REFERBACK IN THE RC FIELD
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jun 01, 2012 6:43 pm
Reply with quote

That should definitely be STEP1.Rc
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Fri Jun 01, 2012 6:50 pm
Reply with quote

I get the same error:

//JHSA29X JOB (1617,JRH,W811),'EDI REPORT',MSGCLASS=X,CLASS=A,USER=JRH
//STEP1 EXEC SORT
//SORTIN DD DSN=TEMP.JRH.MANUAL,DISP=(OLD,DELETE)
//SORTOF1 DD DSN=&&CHEPEML,DISP=(NEW,PASS)
//SYMNAMES DD DSN=CTLCDS.DUDA(SYMNAMES),DISP=SHR
//SYSIN DD DISP=SHR,DSN=CTLCDS.DUDA(ODSA29)
// IF STEP1.RC = 0 THEN
//MAILIT EXEC MAILREPT
//MFMAIL.REPORT DD DSN=&&CHEPEML,DISP=(OLD,DELETE)
//MFMAIL.SYSTSIN DD *
%XMITIP (JRH@DUDA.COM) NOMSG FILEDD REPORT -
SUBJECT 'CHEP PALLETS FOR REVERSAL' -
MSGT 'SEE ATTACHMENT FOR REPORT'
// ENDIF
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Jun 01, 2012 7:00 pm
Reply with quote

Post the job output, especially the JES and SORT messages, using the CODE tag to preserve spacing. I suspect your problem is not what you think it is.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri Jun 01, 2012 7:04 pm
Reply with quote

Pandora-Box wrote:
That should definitely be STEP1.Rc

No; SORT is the name of a procedure, thus the reference should be:
Code:
//         IF   (STEP1.procstepname.RC = 0) THEN
Back to top
View user's profile Send private message
jr3011

New User


Joined: 17 Apr 2008
Posts: 26
Location: Oviedo, FL

PostPosted: Fri Jun 01, 2012 7:06 pm
Reply with quote

Yes, that worked thanks.

// IF step1.sort.rc = 0 then
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Jun 01, 2012 7:09 pm
Reply with quote

Akatsukami wrote:
Pandora-Box wrote:
That should definitely be STEP1.Rc

No; SORT is the name of a procedure, thus the reference should be:
Code:
//         IF   (STEP1.procstepname.RC = 0) THEN




Arghhhhh

I never saw that my mistake

Thanks Akatsukami for bringing my tautology to an end
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 577
Location: USA

PostPosted: Fri Jun 01, 2012 8:29 pm
Reply with quote

jr3011,

It would have been easier if you had referred to this

Pay close attention to Relational-Expression Keywords

Thanks,
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 Conditional EATTR in MFS ? IMS DB/DC 0
No new posts Conditional replace values in output ... DFSORT/ICETOOL 3
No new posts Conditional step execution based on P... JCL & VSAM 9
No new posts Summing records conditional statements. SYNCSORT 13
No new posts Conditional setting of return-code af... COBOL Programming 9
Search our Forums:

Back to Top