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
 

 

Getting output as space record when using empty file.

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

New User


Joined: 21 Jul 2007
Posts: 27
Location: Chennai

PostPosted: Thu Jul 24, 2008 12:01 pm    Post subject: Getting output as space record when using empty file.
Reply with quote

Hi Frank Yaeger,

When I use below sort with empty file i am getting output as a space record.

Code:

  SORT FIELDS=(01,05,CH,A,
               06,05,CH,A,
               11,10,CH,A,
               21,10,CH,A),EQUALS
  OUTFIL REMOVECC,NODETAIL,
  SECTIONS=(01,20,TRAILER3=(1,50))


Help me to ignore this space record.
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: Thu Jul 24, 2008 9:00 pm    Post subject:
Reply with quote

Those control statements give you one blank TRAILER3 output record when SORTIN has no records.

Quote:
Help me to ignore this space record.


What do you mean by this? Do you want an empty output file when the input file is empty, or do you want something else?
Back to top
View user's profile Send private message
kalaikala

New User


Joined: 21 Jul 2007
Posts: 27
Location: Chennai

PostPosted: Fri Jul 25, 2008 4:17 pm    Post subject: Reply to: Getting output as space record when using empty fi
Reply with quote

I want an empty output file when the input file is empty.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Jul 25, 2008 11:41 pm    Post subject: Reply to: Getting output as space record when using empty fi
Reply with quote

kalaikala,

The following DFSORT/ICETOOL JCL will give you the desired results. The LAST parm on the SELECT operator does the same as the sections with trailer3. I also combined all your sort fields as 1 single field because they are continuous fields with the same format. Select operator has EQUALS as default

Code:

//STEP0100 EXEC PGM=ICETOOL   
//TOOLMSG  DD SYSOUT=*         
//DFSMSG   DD SYSOUT=*         
//IN       DD DSN=Your input file,
//            DISP=SHR
//OUT      DD DSN=Your output file,
//            DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,
//            SPACE=(CYL,(X,Y),RLSE)
//TOOLIN   DD *                                       
  SELECT FROM(IN) TO(OUT) ON(1,20,CH) LAST USING(CTL1)
//CTL1CNTL DD *                                       
  SORT FIELDS=(01,30,CH,A)                             
  OUTFIL FNAMES=OUT,BUILD=(1,50)   


Hope this helps...

Cheers
Back to top
View user's profile Send private message
kalaikala

New User


Joined: 21 Jul 2007
Posts: 27
Location: Chennai

PostPosted: Mon Jul 28, 2008 11:37 am    Post subject: Reply to: Getting output as space record when using empty fi
Reply with quote

Thanks Skolusu!

Is it possible to solve this problem using the below SORT card itself?.

Code:

  SORT FIELDS=(01,05,CH,A,
               06,05,CH,A,
               11,10,CH,A,
               21,10,CH,A),EQUALS
  OUTFIL REMOVECC,NODETAIL,
  SECTIONS=(01,20,TRAILER3=(1,50))
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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


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