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
 
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 Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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