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

SORT deletes the SORTOUT file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
icetigerfan

New User


Joined: 08 Mar 2010
Posts: 13
Location: Nuremberg, Germany

PostPosted: Thu Oct 27, 2022 2:46 pm
Reply with quote

Hi,
I am just in despair.
I have a job in a job chain that sorts a previously created file. This file is then processed by various subsequent jobs.

Now the just created SORTOUT is deleted by SORT as soon as the input file does not contain any records. So the subsequent jobs abort. What can I do so that the empty SORTOUT is not deleted.

By the way, the job has run without problems for the last 20 years and has always created an empty SORTOUT if the SORTIN did not contain any records.

I attach the respective job step.

Code:
//STEP030  EXEC PROC=PGMLOAD,DBID=31,PROG=SORT                 
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=infile,DISP=(OLD,DELETE,KEEP)   
//SORTOUT  DD DSN=outfile,DISP=(NEW,CATLG,DELETE),     
//            DCB=(LRECL=32095,RECFM=VB),                       
//            SPACE=(CYL,(20,40),RLSE)                         
 SORT FIELDS=(9,3,A,30,6,A,36,26,A,62,48,A,113,4,A),FORMAT=CH   
 RECORD TYPE=V,LENGTH=32095     
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1205
Location: Dublin, Ireland

PostPosted: Thu Oct 27, 2022 3:02 pm
Reply with quote

What is the JCL in the PGMLOAD procedure?

Garry.
Back to top
View user's profile Send private message
icetigerfan

New User


Joined: 08 Mar 2010
Posts: 13
Location: Nuremberg, Germany

PostPosted: Thu Oct 27, 2022 3:12 pm
Reply with quote

A Cobol program that creates a list, but the list can be empty.

Code:
//*------------------------------------------------------------------***
//STEP020  EXEC PROC=PGMLOAD,DBID=31,PROG=COBPROG                     
//SYSPRINT DD SYSOUT=*                                                 
//MBSPRO   DD SYSOUT=*                                                 
//QUELL2   DD DSN=input1,DISP=SHR     
//PROTOK   DD DSN=protdat,DISP=(MOD,KEEP)             
//WORKFILE DD DSN=infile,                                 
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(CYL,(20,40),RLSE),                                 
//            DCB=(LRECL=32095,RECFM=VB)                               
//STEUFI   DD DUMMY                                                     
//VLKARTE  DD *                                                         
E31                                                                     
//*------------------------------------------------------------------***
 //STEP030  EXEC PROC=PGMLOAD,DBID=31,PROG=SORT                 
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=infile,DISP=(OLD,DELETE,KEEP)   
//SORTOUT  DD DSN=outfile,DISP=(NEW,CATLG,DELETE),     
//            DCB=(LRECL=32095,RECFM=VB),                       
//            SPACE=(CYL,(20,40),RLSE)                         
 SORT FIELDS=(9,3,A,30,6,A,36,26,A,62,48,A,113,4,A),FORMAT=CH   
 RECORD TYPE=V,LENGTH=32095   
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Thu Oct 27, 2022 4:16 pm
Reply with quote

Show the resolved PROC and also add the //SYSIN DD to the stream (it's missing).
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Oct 27, 2022 4:57 pm
Reply with quote

Joerg.Findeisen wrote:
Show the resolved PROC and also add the //SYSIN DD to the stream (it's missing).

And also: include the part of SDSF log showing the point where your SORTOUT has been deleted!
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Oct 27, 2022 5:04 pm
Reply with quote

One stupid question: where your abstract "DSN=infile" and "DSN=outfile" come from?
There is a chance that after "too smart" parameter substitution you are using the same name in both DSNAMEs?


P.S.
It is a very-very-very bad idea: asking abstract questions without giving any specific detail.
It is the same as the question: "I did everything right, but the result was wrong. Please, help!"
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2141
Location: USA

PostPosted: Thu Oct 27, 2022 8:56 pm
Reply with quote

icetigerfan wrote:
A Cobol program that creates a list, but the list can be empty.

Code:
//*------------------------------------------------------------------***
//STEP020  EXEC PROC=PGMLOAD,DBID=31,PROG=COBPROG                     
//SYSPRINT DD SYSOUT=*                                                 
//MBSPRO   DD SYSOUT=*                                                 
//QUELL2   DD DSN=input1,DISP=SHR     
//PROTOK   DD DSN=protdat,DISP=(MOD,KEEP)             
//WORKFILE DD DSN=infile,                                 
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(CYL,(20,40),RLSE),                                 
//            DCB=(LRECL=32095,RECFM=VB)                               
//STEUFI   DD DUMMY                                                     
//VLKARTE  DD *                                                         
E31                                                                     
//*------------------------------------------------------------------***
 //STEP030  EXEC PROC=PGMLOAD,DBID=31,PROG=SORT                 
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=infile,DISP=(OLD,DELETE,KEEP)   
//SORTOUT  DD DSN=outfile,DISP=(NEW,CATLG,DELETE),     
//            DCB=(LRECL=32095,RECFM=VB),                       
//            SPACE=(CYL,(20,40),RLSE)                         
 SORT FIELDS=(9,3,A,30,6,A,36,26,A,62,48,A,113,4,A),FORMAT=CH   
 RECORD TYPE=V,LENGTH=32095   


Sorry for being so straightforward, but this reminds me ravings of lunatic: using THE SAME JCL PROC, while running ABSOLUTELY DIFFERENT PROGRAMS!!??
icon_pray.gif 12.gif icon_axe.gif

Such way of coding is the basic origin for "mysterious disappearing of datasets", and other "miracles".

To say nothing about the fact, that SORT has no physical ability to "delete datasets" (according to the Topic name).
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Fri Oct 28, 2022 1:20 pm
Reply with quote

Can we assume that the blank in front of
//STEP030 EXEC PROC=PGMLOAD,DBID=31,PROG=SORT
is a cut/paste error? If not then you essentially only have one step.
Like Segeyken I wonder what really is in that PGMLOAD proc since you seem to override most JCL.
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 734
Location: Denmark

PostPosted: Fri Oct 28, 2022 1:30 pm
Reply with quote

And I too would like to see the SDSF listing.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Unable to interpret a hex value to De... COBOL Programming 7
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Is this possible via sort (in one pass)? SYNCSORT 4
No new posts GDG generation name to GDG Base name ... DFSORT/ICETOOL 3
No new posts SORT on detail record, then repeat he... DFSORT/ICETOOL 3
Search our Forums:

Back to Top