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

syncsort not giving bad code when nothing found


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
valadezm

New User


Joined: 05 May 2006
Posts: 7

PostPosted: Thu Apr 09, 2009 5:11 am
Reply with quote

Hello.

I am doing a syncsort copy using JCL below

Code:
/SORTEXTR EXEC  PGM=SYNCSORT
/*-----------------------------------------------
/SYSOUT   DD  SYSOUT=*
/SYSUDUMP DD  SYSOUT=*
/*
/SORTIN   DD  DSN=AFSMAV.PRICECHK,
/             DISP=OLD
/*
/SORTOUT  DD  DSN=AFSMAV.PRICECHK.D2,
/             DISP=(NEW,CATLG,DELETE),
/             UNIT=SYSDA,
/             SPACE=(TRK,(15,15),RLSE),
/             DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0)
/SYSIN    DD  *
 SORT FIELDS=COPY
 INCLUDE COND=(10,2,CH,EQ,C'NO QUEUE RECORDS')



The problem is that even though the condition is not met, syncsort is still giving me a code 0 on the step. I only want the code=0 when the records are found. As it stands now, if the data is not found, it still creates an empty dataset and gives a code=0.

I want it to give a different code if it's not successful.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 09, 2009 5:39 am
Reply with quote

I'm not aware of Syncsort's ability to set return codes upon record count.
I think an additional step with IDCAMS could provide you with what you need.
Do you need a pointer to the utility?
Back to top
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Thu Apr 09, 2009 6:31 am
Reply with quote

Did you try the NULLOUT parameter:

Code:

//SORTEXTR EXEC PGM=SYNCSORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=AFSMAV.PRICECHK,DISP=OLD
//SORTOUT  DD  DSN=AFSMAV.PRICECHK.D2,
//         DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,(15,15),RLSE),
//         RECFM=FBA
//SYSIN    DD  *
  OPTION COPY,NULLOUT=RC4   
  INCLUDE COND=(10,16,CH,EQ,C'NO QUEUE RECORDS')
/*
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Thu Apr 09, 2009 6:59 am
Reply with quote

superk wrote:
Did you try the NULLOUT parameter
Thanks for that....
SyncSort for z/OS 1.3 Programmer’s Guide
Chapter 5. PARM Options wrote:
NULLOUT= RC0 /RC4 /RC16 Specifies the action to be taken when SORTOUT contains no records.
Back to top
View user's profile Send private message
valadezm

New User


Joined: 05 May 2006
Posts: 7

PostPosted: Thu Apr 09, 2009 5:19 pm
Reply with quote

superk wrote:
Did you try the NULLOUT parameter:

Code:

//SORTEXTR EXEC PGM=SYNCSORT
//SYSOUT   DD  SYSOUT=*
//SORTIN   DD  DSN=AFSMAV.PRICECHK,DISP=OLD
//SORTOUT  DD  DSN=AFSMAV.PRICECHK.D2,
//         DISP=(,CATLG,DELETE),
//         UNIT=SYSDA,
//         SPACE=(TRK,(15,15),RLSE),
//         RECFM=FBA
//SYSIN    DD  *
  OPTION COPY,NULLOUT=RC4   
  INCLUDE COND=(10,16,CH,EQ,C'NO QUEUE RECORDS')
/*


Thanks! Worked like a charm.
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top