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
 

 

How to delete a blank line in Dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
rulerofera

New User


Joined: 03 Jun 2008
Posts: 30
Location: India

PostPosted: Tue Dec 22, 2009 8:36 pm    Post subject: How to delete a blank line in Dataset
Reply with quote

I have to delete one of two consecutive blank lines from dataset with record length 140, keeping everything else intact.

Can any of you help me with this, if not through ISPF can this be done through IEBGENER.
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Dec 22, 2009 8:44 pm    Post subject: Reply to: How to delete a blank line in Dataset
Reply with quote

OK, what are we not being told about here? Certainly you can easily edit the dataset and just use either a Delete or Exclude command for those two records?
Back to top
View user's profile Send private message
rulerofera

New User


Joined: 03 Jun 2008
Posts: 30
Location: India

PostPosted: Tue Dec 22, 2009 8:56 pm    Post subject:
Reply with quote

Now, consider a situation where I have many such consecutive blank records in my dataset intersperse with data records.
So my requirement is wherever there are more than one consecutive blank records I have to keep just one of it and delete other blank (all spaces) records.
So which means in-between data records there can never be more than one blank record.

Infact, this was my orginal question, apologies if I was unclear the first time.
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Dec 22, 2009 11:05 pm    Post subject:
Reply with quote

if this is a process you need to run frequently, the easiest way is a small rexx program that simply reads in records and rewrites them without writing duplicate blanks (compare current record to blanks and to last record and write accordingly).

Or if the data is small enough to fit in the editor, you can write an edit macro. see the ISPF edit and edit macros book or search for examples of programs containing ISREDIT.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Dec 23, 2009 8:28 am    Post subject:
Reply with quote

Hi,

I cannot see how IEBGENER can achieve what you want, if DFSORT is an option, then you can try this
Code:
//STEP0100 EXEC PGM=ICEMAN                             
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD DSN=input-dsn,DISP=SHR                   
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                     
  OUTREC IFTHEN=(WHEN=INIT,                             
        OVERLAY=(141:SEQNUM,8,ZD,RESTART=(1,140)))     
  OUTFIL OMIT=(141,8,ZD,GT,+1,AND,                     
               1,140,CH,EQ,C' '),                       
               BUILD=(1,140)                           
/*



Gerry
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Dec 23, 2009 10:14 am    Post subject:
Reply with quote

here is a clist edit macro which I have used to drop duplicate rows in an
editable ds/pds(mbr).
if two or more successive rows are equal, the second (and subsequent will be excluded) - thus leaving only one row from the original group.
this was written to find 'duplicates within column range' regardless of value.
you will have to add an edit macro command at the end to 'show' all lines that have any characters before deleting all excluded lines.

Code:

ISREDIT MACRO
CONTROL NOLIST NOCONLIST NOSYMLIST NOPROMPT NOMSG NOFLUSH ASIS END(ENDO)
ISREDIT RESET
ISREDIT (NUMLNS) = LINENUM .ZL
ISREDIT (CURLN) = LINENUM .ZF
SET LASTLN = &STR()
SET THISLN = &STR()
SET &STCOL = 1
SET &ENDCOL = 140
  DO WHILE &CURLN < &NUMLNS + 1
      ISREDIT (THISLN) = LINE &CURLN
      SET THISLN =  &SUBSTR(&STCOL:&ENDCOL,&THISLN)
      IF  &STR(&THISLN) = &STR(&LASTLN) THEN +
          DO
            ISREDIT CURSOR =  &CURLN
            ISREDIT EXCLUDE ALL .ZCSR .ZCSR
          ENDO
      SET LASTLN = &STR(&THISLN)
      SET LSTLN = &CURLN
      SET CURLN = &CURLN + 1
  ENDO
  add a line here to find all char <> spaces which will 'show' excluded
   lines that are not all spaces
  then:
ISREDIT DELETE ALL X
EXIT


this can be written in rexx, easily.
you can also modify it to ARG(starting_column, ending_column)
so that you can look for duplicates within a column range. it is hard coded to search 1 thru 140 in this example.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Wed Dec 23, 2009 10:59 am    Post subject:
Reply with quote

Hi Dick,

you never cease to amaze me, you can still spell CLIST ho ho ho icon_lol.gif


Gerry
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am


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