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
 

 

Omit the records which are spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Omit the records which are spaces
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    Post subject:
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

Site Director


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

PostPosted: Sat Jun 16, 2007 8:09 pm    Post subject:
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 Moderator


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

PostPosted: Mon Jun 18, 2007 8:41 pm    Post subject:
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

Site Director


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

PostPosted: Mon Jun 18, 2007 11:54 pm    Post subject:
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    Post subject: Re: Omit the records which are spaces
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    Post subject:
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 Moderator


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

PostPosted: Thu Jun 21, 2007 8:31 pm    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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