View previous topic :: View next topic
|
Author |
Message |
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
And also refer to NULLOFL and NULLOUT
NULLOUT applies to the SORTOUT data set. NULLOFL applies to OUTFIL data sets
Thanks, |
|
Back to top |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
thanks alot, this works for me.. |
|
Back to top |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
why two if and one end if? |
|
Back to top |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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 |
|
|
Naish
New User
Joined: 07 Dec 2006 Posts: 82 Location: UK
|
|
|
|
Could you show us the JESYSMSG from your SPOOL?
Thanks. |
|
Back to top |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
That should definitely be STEP1.Rc |
|
Back to top |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
jr3011
New User
Joined: 17 Apr 2008 Posts: 26 Location: Oviedo, FL
|
|
|
|
Yes, that worked thanks.
// IF step1.sort.rc = 0 then |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
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 |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
jr3011,
It would have been easier if you had referred to this
Pay close attention to Relational-Expression Keywords
Thanks, |
|
Back to top |
|
|
|