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

How to delete blank line is dataset using commends


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Fri Dec 14, 2012 3:25 pm
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
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

Global Moderator


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

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

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

Global Moderator


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

PostPosted: Fri Dec 14, 2012 7:59 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Fri Dec 14, 2012 8:30 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Sat Dec 15, 2012 12:43 am
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

Global Moderator


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

PostPosted: Sat Dec 15, 2012 12:49 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Sat Dec 15, 2012 2:46 am
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: 1788
Location: Bloomington, IL

PostPosted: Sat Dec 15, 2012 2:53 am
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Sat Dec 15, 2012 3:19 am
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
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

Moderator Emeritus


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

PostPosted: Sun Dec 16, 2012 4:39 am
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
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
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: 93
Location: India

PostPosted: Fri Jan 11, 2013 2:41 pm
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

Global Moderator


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

PostPosted: Fri Jan 11, 2013 8:06 pm
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
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Jan 11, 2013 9:24 pm
Reply with quote

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

x all p'¬'
flip
del all x 
I was not sure initially how to type the '⌐' character. Just for those who are not sure how to do that - You will need to type '1', '6', '9' keeping the ALT button pressed in the keyboard.... icon_razz.gif
Hope this method works for everybody
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Jan 12, 2013 12:24 am
Reply with quote

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


Can you elaborate on the 'Bummer'?.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Sat Jan 12, 2013 12:28 am
Reply with quote

Quote:
I was not sure initially how to type the '⌐' character. Just for those who are not sure how to do that


More typically, it is a simple Shift/6 (uppercase of number 6). When you type it in the editor, it should add the ^ character which is '5F'x.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Sat Jan 12, 2013 2:12 am
Reply with quote

Hi Pedro,

Shift/6 is typing in the '^' character. When I give this command on the TSO it is not working as expected. The '⌐' (ALT-1 6 9) is working though ... icon_smile.gif
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


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

PostPosted: Sat Jan 12, 2013 2:31 am
Reply with quote

Gary McDowell wrote:
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.

As in honest-to-Kamisami 327x terminals as used in the 1970s?
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 -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
No new posts Repeat a DD line- comment and insert ... CA Products 3
No new posts Dataset size increase on adding 1 byt... DFSORT/ICETOOL 8
No new posts Delete file row if blanks in the firs... DFSORT/ICETOOL 5
No new posts volume mass delete RMM JCL & VSAM 2
Search our Forums:

Back to Top