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
 

 

syncsort not giving bad code when nothing found

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: syncsort not giving bad code when nothing found
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 09, 2009 5:39 am    Post subject:
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

Moderator Team Head


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

PostPosted: Thu Apr 09, 2009 6:31 am    Post subject: Reply to: syncsort not giving bad code when nothing found
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: 2150
Location: At my coffee table

PostPosted: Thu Apr 09, 2009 6:59 am    Post subject:
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    Post subject: Re: Reply to: syncsort not giving bad code when nothing foun
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts Row not found Sql error GaganGarg DB2 7 Tue Mar 07, 2017 6:29 am


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