Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Getting output records in SORTOUT even with empty input

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Fri Sep 22, 2006 12:10 am    Post subject: Getting output records in SORTOUT even with empty input
Reply with quote

Hi all,

I am using the below sort card in one the steps in JCL.

SORT FIELDS=(1,10,CH,A)
OUTFIL REMOVECC,NODETAIL,
SECTIONS=(1,10,
TRAILER3=(1,10,X,COUNT=(M11,LENGTH=9)))

Its working fine when there are some records in Input but its giving one output record even when the input file is empty.

Output record

000000000
(Nine zeros at the position of count) Where as I would like to have the output as empty in above case.

I am new to SORT and would appreciate help on this.

-thanks
David P.
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Sep 22, 2006 1:09 am    Post subject:
Reply with quote

TRAILER3 is supposed to write a record even when the input file is empty.

You can easily eliminate that record when the count is all 0's with a DFSORT/ICETOOL job like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=... input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD DSN=...  output file
//TOOLIN   DD    *
SORT FROM(IN) USING(CTL1)
COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,10,CH,A)
  OUTFIL FNAMES=T1,REMOVECC,NODETAIL,
    SECTIONS=(1,10,
    TRAILER3=(1,10,X,COUNT=(M11,LENGTH=9)))
/*
//CTL2CNTL DD *
  OMIT COND=(12,9,ZD,EQ,+0)
/*
Back to top
View user's profile Send private message
David P

Active User


Joined: 11 Apr 2005
Posts: 106
Location: Cincinnati Ohio

PostPosted: Fri Sep 22, 2006 1:14 am    Post subject: Re: Getting output records in SORTOUT even with empty input
Reply with quote

Thanks Frank for your quick response.

-David P.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Subtract the ZD fields to provide neg... Balaryan DFSORT/ICETOOL 4 Wed Oct 11, 2017 10:51 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Where is output from PARM ABEXIT (SNA... packerm CA Products 3 Thu Sep 28, 2017 4:06 pm
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us