Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 Speed-up/reduce CPU use of code prino PL/I & Assembler 0 Tue Sep 26, 2017 12:05 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts I want to retire TRX and use only Rex... Abhinav Sharma CLIST & REXX 6 Sat Jul 29, 2017 2:53 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us