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
 

 

Empty file to SYNCsort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Empty file to SYNCsort
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 28, 2009 5:36 pm    Post subject: Re: Empty file to SYNCsort
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: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 28, 2009 5:44 pm    Post subject:
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    Post subject: Re: Empty file to SYNCsort
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 28, 2009 5:58 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 28, 2009 8:06 pm    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Tue Apr 28, 2009 8:31 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Apr 29, 2009 12:09 pm    Post subject: Reply to: Empty file to SYNCsort
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 29, 2009 1:55 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Apr 29, 2009 5:24 pm    Post subject:
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    Post subject:
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    Post subject:
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: 2158
Location: @my desk

PostPosted: Fri Jun 05, 2009 4:38 pm    Post subject:
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    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 syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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