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

Empty file to SYNCsort


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

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Apr 28, 2009 5:29 pm
Reply with quote

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
View user's profile Send private message
yasodha_p

New User


Joined: 03 Apr 2008
Posts: 14
Location: Chennai

PostPosted: Tue Apr 28, 2009 5:31 pm
Reply with quote

You can give COND parameter in the step
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: Tue Apr 28, 2009 5:36 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Apr 28, 2009 5:44 pm
Reply with quote

yasodha_p wrote:
You can give COND parameter in the step

Please explain what you mean by this ?
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Apr 28, 2009 5:45 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Tue Apr 28, 2009 5:58 pm
Reply with quote

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
View user's profile Send private message
yasodha_p

New User


Joined: 03 Apr 2008
Posts: 14
Location: Chennai

PostPosted: Tue Apr 28, 2009 6:57 pm
Reply with quote

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
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Tue Apr 28, 2009 7:58 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Tue Apr 28, 2009 8:06 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Tue Apr 28, 2009 8:31 pm
Reply with quote

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
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Wed Apr 29, 2009 10:51 am
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Apr 29, 2009 12:09 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Wed Apr 29, 2009 1:55 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 29, 2009 5:24 pm
Reply with quote

Just thinking . . . can NULLOUT parameter be a choice here?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Apr 29, 2009 5:38 pm
Reply with quote

For a DUMMY input file just provide DCB parameters for RECFM, LRECL, and BLKSIZE.
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Fri Jun 05, 2009 4:25 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Fri Jun 05, 2009 4:38 pm
Reply with quote

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
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 to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top