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
 
How to delete blank line is dataset using commends
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Dec 14, 2012 3:15 pm    Post subject: How to delete blank line is dataset using commends
Reply with quote

Hi Friends,

could you please help me how to delete blank line in a dataset using commends.

For exp:

The below data avaible in a PS

Raja
ravi

mani
mohan

ram
kani

after executing comments the results should be

Raja
ravi
mani
mohan
ram
kani
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Fri Dec 14, 2012 3:25 pm    Post subject:
Reply with quote

Code:
X ALL '              ' 1;DEL X ALL;SAVE
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Fri Dec 14, 2012 6:36 pm    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Thanks for your reply.

The record length is more than 50 means we cann't use this commend right?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1542
Location: Andromeda Galaxy

PostPosted: Fri Dec 14, 2012 6:47 pm    Post subject:
Reply with quote

Why so specific that you need using Macro?
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2083
Location: Silicon Valley

PostPosted: Fri Dec 14, 2012 7:59 pm    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Code:
x p'^' all
flip
del all x
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Fri Dec 14, 2012 8:30 pm    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Quote:
The record length is more than 50 means we cann't use this commend right?


NO ... WRONG.

instead of posting irrelevant comments wouldn ' t it be faster to try?
( even on a small file )
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Sat Dec 15, 2012 12:29 am    Post subject:
Reply with quote

Pandora-Box wrote:
Code:
X ALL '              ' 1;DEL X ALL;SAVE

Nice! I never thought of that.

Off the top of my head I would have done…
SORT
delete the blank lines

...but I like the X ALL solution better.
Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Sat Dec 15, 2012 12:43 am    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

IMO Pedro suggestion is better
it will find non blank characters in any position of the record
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2083
Location: Silicon Valley

PostPosted: Sat Dec 15, 2012 12:49 am    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Based on the sample data, Pandora's commands will work.

But the data shown was too simple for 'how to delete blank line?'. If you have blanks in the first 20 columns but have data anywhere in columns 20 - 80, it will delete those lines as well.

My example will only delete lines that do not have any other characters.
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Sat Dec 15, 2012 2:41 am    Post subject: Re: Reply to: How to delete blank line is dataset using comm
Reply with quote

Pedro wrote:
Code:
x p'^' all
flip
del all x

Hmm, I did the following with the test data in original post and all lines were deleted. Not sure what I did incorrectly.
X P'^' ALL;FLIP;DEL ALL X
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Sat Dec 15, 2012 2:46 am    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

I usually go for ..

Code:
EXCLUDE ALL
FIND P'^' ALL
DEL X ALL


watch for the ^ character depending on the codepage used it might be translated to something else
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1775
Location: Bloomington, IL

PostPosted: Sat Dec 15, 2012 2:53 am    Post subject: Re: Reply to: How to delete blank line is dataset using comm
Reply with quote

Gary McDowell wrote:
Pedro wrote:
Code:
x p'^' all
flip
del all x

Hmm, I did the following with the test data in original post and all lines were deleted. Not sure what I did incorrectly.
X P'^' ALL;FLIP;DEL ALL X

You recognize that the circumflex (^) has been substituted for the logical NOT (¬)? P'¬' is interpreted by Edit as "all non-spaces"; P'^' is interpreted as "all circumflexes".
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Sat Dec 15, 2012 2:54 am    Post subject: Re: Reply to: How to delete blank line is dataset using comm
Reply with quote

enrico-sorichetti wrote:
I usually go for ..

Code:
EXCLUDE ALL
FIND P'^' ALL
DEL X ALL


watch for the ^ character depending on the codepage used it might be translated to something else

Hmm, same result; all 8-lines of the test data were deleted. I ask two other developers to try also and we all got the data deleted.

Hey, thanks anyway.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10308
Location: italy

PostPosted: Sat Dec 15, 2012 3:19 am    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Quote:
Hmm, same result; all 8-lines of the test data were deleted. I ask two other developers to try also and we all got the data deleted.


unfortunately Your 3270 codepage is <fouled> up

just tested with the 1047 codepage and it works just right
Back to top
View user's profile Send private message
Gary McDowell

Active User


Joined: 15 Oct 2012
Posts: 139
Location: USA

PostPosted: Sat Dec 15, 2012 3:29 am    Post subject: Re: Reply to: How to delete blank line is dataset using comm
Reply with quote

enrico-sorichetti wrote:

unfortunately Your 3270 codepage is <fouled> up

just tested with the 1047 codepage and it works just right

Yep, we have 3270's. Bummer.
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: Sun Dec 16, 2012 4:39 am    Post subject:
Reply with quote

Hello,

Quote:
Yep, we have 3270's. Bummer.


Uh - MisUnderstandingAlert . . .

We pretty much ALL use 3270 Emulation - this is the "standard" terminal interface to the mainframe.

The Codepages are different definitions of how characters are to be handled. Whet Enrico posted says that usng the code page 1047, the process works.

Suggest you talk with whoever supports your terminal emulator product to see how yours is configured.
Back to top
View user's profile Send private message
cmsmoon

New User


Joined: 17 Jun 2010
Posts: 75
Location: Chennai

PostPosted: Tue Dec 18, 2012 3:51 pm    Post subject: Re: Reply to: How to delete blank line is dataset using comm
Reply with quote

Akatsukami wrote:
Gary McDowell wrote:
Pedro wrote:
Code:
x p'^' all
flip
del all x

Hmm, I did the following with the test data in original post and all lines were deleted. Not sure what I did incorrectly.
X P'^' ALL;FLIP;DEL ALL X

You recognize that the circumflex (^) has been substituted for the logical NOT (¬)? P'¬' is interpreted by Edit as "all non-spaces"; P'^' is interpreted as "all circumflexes".



Thanks it is working
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Tue Dec 18, 2012 8:33 pm    Post subject:
Reply with quote

fyi : del all nx = flip ; del all x
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 94
Location: India

PostPosted: Fri Jan 11, 2013 2:41 pm    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Try Akatsukami's suggestion in 3270, that will work.
Code:

x all p'¬'
flip
del all x 
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2083
Location: Silicon Valley

PostPosted: Fri Jan 11, 2013 8:06 pm    Post subject: Reply to: How to delete blank line is dataset using commends
Reply with quote

Quote:
fyi : del all nx = flip ; del all x

If you use DEL ALL NX, your screen will have only excluded lines. You will not see what you want to see.
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
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Delete IMS remote transaction when MO... Sam Singh IMS DB/DC 0 Wed Aug 23, 2017 9:12 pm
No new posts Unable to copy data from spool in a d... srikant314 JCL & VSAM 8 Fri Jul 28, 2017 9:10 pm

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