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

Getting output as space record when using empty file.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Thu Jul 24, 2008 9:00 pm
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top