Sorting 2 files (one with no data) produces no output?



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Sorting 2 files (one with no data) produces no output?

Postby D9988 » Thu Mar 08, 2012 11:43 pm

Hello, I 've run across an issue where I have 2 input datasets to sort. One of the input datasets is empty (sometimes this will be the case, sometimes it will be populated. The output dataset has no data. I need this to produce output even if one of the files is empty. Any ideas? The LRECL for both files is not defined earlier in the job, if that makes any difference.

//T01JOB EXEC PGM=SORT,PARM='SIZE=MAX'                               
//*                                                                     
//SYSOUT    DD SYSOUT=(,)                                               
//*                                                                     
//*******  I N P U T   F I L E (S) ***********                         
//*                                                                     
//SORTIN    DD DSN=TEST.NEW(+1),DISP=SHR     
//          DD DSN=TEST.OLD(+1),DISP=SHR               
//*                                                                     
//*******  O U T P U T   F I L E (S) *********                         
//*                                                                     
//SORTOUT   DD DSN=TEST.COMBINED(+1),           
//             DISP=(NEW,CATLG,DELETE),MGMTCLAS=I1WBRA1Q,               
//             STORCLAS=NORMAL,SPACE=(CYL,(19,5),RLSE),                 
//             DCB=(MODLDSCB,RECFM=FB,BLKSIZE=0)                       
//*                                                                     
//*******  S O R T W O R K   F I L E(S)  ********   
//*                                                       
//SORTWK01  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,         
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE)     
//*                                                       
//SORTWK02  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,         
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE)     
//*                                                       
//SORTWK03  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,         
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE)     
//*                                                       
//SORTWK04  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,         
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE)     
//*                                                       
//SORTWK05  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,         
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE)     
//*                                                       
//SORTWK06  DD MGMTCLAS=D0DB0A0D,STORCLAS=NORMAL,       
//             DATACLAS=SEQ,SPACE=(CYL,(150,50),RLSE) 
//*                                                   
//*******  S O R T  F I E L D S **************         
//*                                                   
//SYSIN     DD *                                       
  SORT FIELDS=(9,8,A,1,8,A),                           
       FORMAT=BI                                       
/*                                                                         


The SYSOUT from that step is:
ICE143I 0 BLOCKSET SORT TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 12:46 ON WED MA

SORT FIELDS=(9,8,A,1,8,A),
FORMAT=BI
ICE201I H RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE751I 0 C5-K90025 C6-K90025 C7-K54603 C8-K62201 E4-K51707 C9-BASE E5-K62201
ICE193I 0 ICEAM1 INVOCATION ENVIRONMENT IN EFFECT - ICEAM1 ENVIRONMENT SELECTED
ICE088I 1 TESTJOB.T01JOB , INPUT LRECL = 16, BLKSIZE = 27984, TYPE =
ICE093I 0 MAIN STORAGE = (MAX,8388608,8388608)
ICE156I 0 MAIN STORAGE ABOVE 16MB = (8462320,8331248)
ICE127I 0 OPTIONS: OVFLO=RC0 ,PAD=RC0 ,TRUNC=RC0 ,SPANINC=RC16,VLSCMP=N,SZERO=Y,
ICE128I 0 OPTIONS: SIZE=8388608,MAXLIM=6291456,MINLIM=204800,EQUALS=N,LIST=Y,ERE
ICE129I 0 OPTIONS: VIO=N,RESDNT=ALL ,SMF=SHORT,WRKSEC=Y,OUTSEC=Y,VERIFY=N,CHALT=
ICE130I 0 OPTIONS: RESALL=8192,RESINV=0,SVC=109 ,CHECK=Y,WRKREL=Y,OUTREL=Y,CKPT=
ICE131I 0 OPTIONS: TMAXLIM=8388608,ARESALL=131072,ARESINV=0,OVERRGN=65536,CINV=Y
ICE132I 0 OPTIONS: VLSHRT=N,ZDPRINT=N,IEXIT=Y,TEXIT=N,LISTX=N,EFS=NONE ,EXITC
ICE133I 0 OPTIONS: HIPRMAX=0 ,DSPSIZE=0 ,ODMAXBF=0,SOLRF=Y,VLLONG=N,VSAMI
ICE235I 0 OPTIONS: NULLOUT=RC0
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTOUT
ICE084I 0 EXCP ACCESS METHOD USED FOR SORTIN
ICE750I 0 DC 0 TC 0 CS DSVVV KSZ 16 VSZ 16
ICE752I 0 FSZ=1 RC IGN=0 E AVG=16 0 WSP=1 C DYN=0 0
ICE751I 1 DE-K61785 D5-K62201 D9-K61785 E8-K61438
ICE090I 0 OUTPUT LRECL = 16, BLKSIZE = 27984, TYPE = FB (SDB)
ICE080I 0 IN MAIN STORAGE SORT
ICE055I 0 INSERT 0, DELETE 0
ICE054I 0 RECORDS - IN: 0, OUT: 0
ICE173I 0 NO RECORDS FOR THE SORTOUT DATA SET - RC=0
ICE134I 0 NUMBER OF BYTES SORTED: 0
ICE253I 0 RECORDS SORTED - PROCESSED: 0, EXPECTED: 1
ICE165I 0 TOTAL WORK DATA SET TRACKS ALLOCATED: 13500 , TRACKS USED: 0
ICE199I 0 MEMORY OBJECT STORAGE USED = 0M BYTES
ICE180I 0 HIPERSPACE STORAGE USED = 0K BYTES
ICE188I 0 DATA SPACE STORAGE USED = 0K BYTES
ICE052I 0 END OF DFSORT
David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting 2 files (one with no data) produces no output?

 

Re: Sorting 2 files (one with no data) produces no output?

Postby Frank Yaeger » Thu Mar 08, 2012 11:51 pm

DFSORT will produce a non-empty output data set if any of the input files has records.

ICE054I 0 RECORDS - IN: 0, OUT: 0


This message indicates that both input files are empty. If one of the input files was not empty, then IN would be > 0 and OUT would be > 0.

Do both files have the same RECFM and LRECL?

Try sorting each data set separately - that will tell you if either of them actually has any records - my guess is that neither one does.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: Sorting 2 files (one with no data) produces no output?

Postby Akatsukami » Fri Mar 09, 2012 12:15 am

Frank Yaeger wrote:Try sorting each data set separately - that will tell you if either of them actually has any records - my guess is that neither one does.

Since heesh wrote
//SORTIN    DD DSN=TEST.NEW(+1),DISP=SHR     
//          DD DSN=TEST.OLD(+1),DISP=SHR               

I'd venture to say that it is certain that neither data set has any records in it :ugeek:
"You have sat too long for any good you have been doing lately ... Depart, I say; and let us have done with you. In the name of God, go!" -- what I say to a junior programmer at least once a day
User avatar
Akatsukami
Global moderator
 
Posts: 1054
Joined: Sat Oct 16, 2010 2:31 am
Location: Bloomington, IL
Has thanked: 6 times
Been thanked: 51 times

Re: Sorting 2 files (one with no data) produces no output?

Postby D9988 » Fri Mar 09, 2012 12:47 am

Frank Yaeger wrote:DFSORT will produce a non-empty output data set if any of the input files has records.


Thanks Frank. That's good to know, because that is how I thought DFSort worked. I did try running the sort step separately, using the +0 GDG's, and the output worked as anticipated. I must have done something flukey when I ran the test job, because there is only 1 GDG of each file.

Thanks again for the reply!
David
D9988
 
Posts: 34
Joined: Fri Nov 09, 2007 10:55 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Sorting 2 files (one with no data) produces no output?

Postby BillyBoyo » Fri Mar 09, 2012 3:59 am

If you read Akatsukami's post, you'll see that the "flukey" thing you did was to specify a positive relative generation for an input dataset.

If you check the message output from your step, you might see what the step was trying to read. The files would definitely both be empty, at best. I've never tried that, and my guess would have been a JCL error :-)
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Sorting 2 files (one with no data) produces no output?

Postby enrico-sorichetti » Fri Mar 09, 2012 11:16 am

and my guess would have been a JCL error

JCL error certainly not ( at allocation JCL does not know the use of the dataset )
depending on the zOS level and SMS/non-SMS managed You might get unpredictable results or an empty (proper EOF) dataset

see for details
https://www-304.ibm.com/support/docview ... g3T1010312
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2648
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 132 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post