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

Omit the records which are spaces


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

New User


Joined: 06 Apr 2005
Posts: 27

PostPosted: Sat Jun 16, 2007 6:30 pm
Reply with quote

I have a file in which there are thousands of records and some of the records are spaces. How can I put in the condition to remove blank records in the file?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Sat Jun 16, 2007 6:56 pm
Reply with quote

sandra

Is there any mandatory(key) field in your file, that which cannot be blank?
If so, use a sort card to add an omit cond to check if the filed is blank.

Also what is lrecl and RECFM of the file?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Jun 16, 2007 8:09 pm
Reply with quote

Hello,

If i understand the question, there are records that are entirely blank. Even if the blanks are only in particular positions, those can be bypassed also.

No sort key should be needed to OMIT those, just the place(s) where the blanks are not wanted.

Also, if you specify COPY rather than SORT you will preserve the current sequence and have a new file with the blank records removed and it will run faster than sorting..
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: Mon Jun 18, 2007 8:41 pm
Reply with quote

Sandra,

What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 18, 2007 11:54 pm
Reply with quote

Hello Sandra,

You're welcome icon_smile.gif

As Frank asks
Quote:
What is the RECFM and LRECL of your input file?
Back to top
View user's profile Send private message
sandra

New User


Joined: 06 Apr 2005
Posts: 27

PostPosted: Thu Jun 21, 2007 4:23 am
Reply with quote

What is the RECFM and LRECL of your input file?

recfm=FB and LRECL=120
Back to top
View user's profile Send private message
ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Jun 21, 2007 11:07 am
Reply with quote

Hi,

Code:

//STEP1   EXEC PGM=SORT                       
//SORTIN  DD DSN=Input File,DISP=SHR
//SORTOUT DD DSN=Output File,
//         DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,                     
//         SPACE=(CYL,(5,5),RLSE)     
//SYSOUT  DD SYSOUT=*                                   
//SYSIN   DD *                                         
     OPTION COPY                                       
     OMIT COND=(1,120,CH,EQ,C' ')                       
/*                               
                       


--Parag
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 Jun 21, 2007 8:31 pm
Reply with quote

Notice that you only need one blank in the constant - C' '. DFSORT pads a character constant with blanks on the right to match the length of the field, so in this case it pads the constant from 1 blank to 120 blanks. Saves a lot of typing. icon_smile.gif
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 To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
Search our Forums:

Back to Top