View previous topic :: View next topic
|
Author |
Message |
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
I have a syncsort step. Sometimes Input to syncsort is empty, in which case it abends. I want syncsort step not to execute if input file is empty. How do I do this? |
|
Back to top |
|
|
yasodha_p
New User
Joined: 03 Apr 2008 Posts: 14 Location: Chennai
|
|
|
|
You can give COND parameter in the step |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ParagChouguley wrote: |
I have a syncsort step. Sometimes Input to syncsort is empty, in which case it abends. I want syncsort step not to execute if input file is empty. How do I do this? |
Is the file empty?
Was it opened for output in a prior step and then closed without any writing or just allocated by JCL and never really opened? |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
yasodha_p wrote: |
You can give COND parameter in the step |
Please explain what you mean by this ? |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
CICS Guy wrote: |
ParagChouguley wrote: |
I have a syncsort step. Sometimes Input to syncsort is empty, in which case it abends. I want syncsort step not to execute if input file is empty. How do I do this? |
Is the file empty?
Was it opened for output in a prior step and then closed without any writing or just allocated by JCL and never really opened? |
It's an output file of program. Sometimes it's empty. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Quote: |
It's an output file of program. Sometimes it's empty. |
And how does that answer the question?
JCL allocated datasets do not have an EOF written to the dataset. Upon subsequent opening for input, whatever old data is present is read, sometimes generating an error.
Files actually opened for output and closed without any output have an EOF so the next open input sees just the EOF and does not read any further. |
|
Back to top |
|
|
yasodha_p
New User
Joined: 03 Apr 2008 Posts: 14 Location: Chennai
|
|
|
|
sorry for thr late reply guys.
Do the below process
//STEP1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//DD1 DD DSN=INPUTFILE,DISP=SHR
//SYSIN DD *
PRINT INFILE(DD1) COUNT(1) CHAR
// IF (STEP1.RC EQ 0) THEN
//STEP2 EXEC PGM=SYNCSORT
----
----
// ENDIF
In this case, if your file is empty then it STEP1 will end with RC= 4
so the synhcsort step wont execute. |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
OKAY..........
I reformat my question a little.
The Input to syncsort is DD DUMMY. In this case, syncsort abends. Now I don't want it to abend, insted treat DUMMY as empty file and generate output file which will be empty.
What do I do to achieve this?
Sorry for changing the question!
Thanks in advance! |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ParagChouguley wrote: |
The Input to syncsort is DD DUMMY. In this case, syncsort abends. Now I don't want it to abend, insted treat DUMMY as empty file and generate output file which will be empty. |
What is the messages associated with the abend. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
SyncSort for z/OS Programmer’s Guide wrote: |
By default SyncSort does not accept an uninitialized SORTIN data set and will terminate processing with a WER400A message. An uninitialized data set is one that has been newly created but never successfully closed. The UNINTDS PARM or installation option can be used to change SyncSort’s default mode of processing to accept an uninitialized input data set and process it as an empty file. |
In PARM Options the Programmer’s Guide wrote: |
UNINTDS indicates how SyncSort should process a non-VSAM uninitialized DASD input data set in a non-SMS environment. An uninitialized data set is one that has been created but never successfully opened and closed for output. In an SMS environment, uninitialized data sets are always processed as valid empty files. |
|
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Thanks all for your replies.
But I'm afraid that doesn't answer my question.
@yasodha_p, Thanks for your reply, but your JCL will, I guess, work for empty Input file ie. a valid cateloged file with no records in it. But my Input is DD DUMMY.
@CICS Guy,
Thanks a lot for your replies and quotes that you found for me but I wonder how I use them to solve the problem.
BTW, I tried using parm parameter PARM='NULLOUT=RC4' with syncsort. It works with empty file but not with DD DUMMY. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
it is a dummy thing to have a dummy input file for a sort, (*)
what are You trying to achieve??
(*) and maybe against the rules of the product also
what does the manual say on the issue ??? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
ParagChouguley wrote: |
Thanks a lot for your replies and quotes that you found for me but I wonder how I use them to solve the problem. |
I'll just assume that you have problems reading....
For starters, to "solve" your problem, either stop using "an uninitialized SORTIN data set" or temporarily override the UNINTDS parm. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Just thinking . . . can NULLOUT parameter be a choice here? |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
For a DUMMY input file just provide DCB parameters for RECFM, LRECL, and BLKSIZE. |
|
Back to top |
|
|
ParagChouguley
Active User
Joined: 03 Feb 2007 Posts: 175 Location: PUNE(INDIA)
|
|
|
|
Craq Giegerich wrote: |
For a DUMMY input file just provide DCB parameters for RECFM, LRECL, and BLKSIZE. |
Yes, that worked. Thanks a lot ! :-) |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
enrico-sorichetti wrote: |
it is a dummy thing to have a dummy input file for a sort, (*)
what are You trying to achieve?? |
I am just curious, why are you trying to sort a DUMMY? |
|
Back to top |
|
|
|