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
 

 

Any TSO command to delete a column or some columns of PS??

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

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Mon Dec 25, 2006 9:10 pm    Post subject: Any TSO command to delete a column or some columns of PS??
Reply with quote

Is there any TSO command to delete a column or some columns of a flat file???
Back to top
View user's profile Send private message

PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Mon Dec 25, 2006 10:00 pm    Post subject:
Reply with quote

use BOUNDS
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Dec 26, 2006 12:10 am    Post subject:
Reply with quote

You can try this:

Suppose you want to delete cols 5 thru 9. In ISPF Edit enter the following in the cmd line:

c all 5 9 p'=' '' (note: there are no spaces in ''. BTW those are 2 single quotes, not a double quote.)

As I recall, the length of the PS stays the same (verify this).
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 10:31 am    Post subject:
Reply with quote

And just to make it clearer, those are not TSO commands, they are ISPF edit command.

O.
Back to top
View user's profile Send private message
bvanilkumar

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Tue Dec 26, 2006 6:08 pm    Post subject:
Reply with quote

mmwife wrote:
You can try this:

Suppose you want to delete cols 5 thru 9. In ISPF Edit enter the following in the cmd line:

c all 5 9 p'=' '' (note: there are no spaces in ''. BTW those are 2 single quotes, not a double quote.)

As I recall, the length of the PS stays the same (verify this).



It working well to blank the columns. But is there any way to delete the columns between 5 and 9, move 10th column to 5th column, 11th to 6th...??? File length may remain same.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Dec 26, 2006 6:53 pm    Post subject:
Reply with quote

Here's an edit-macro I wrote in the past:
Code:
/*------------------------------- REXX ------------------------------- 
 * PROGRAM   : DELCOLS                                                 
 * FUNCTION  : Delete range of columns.                                 
 * AUTHOR    : OFER                                                     
 * DATE      : 04/04/04                                                 
 * HOW TO USE:                                                         
 *           :                                                         
 *------------------------------------------------------------------*/ 
                                                                       
ADDRESS ISREDIT "MACRO (SPOS EPOS FROM) PROCESS"                       
ADDRESS ISPEXEC "CONTROL ERRORS RETURN"                                 
ADDRESS ISREDIT "(RECLEN) = LRECL"                                     
                                                                       
IF EPOS = ' ' THEN EPOS = RECLEN                                       
                                                                       
IF FROM = ' ' | FROM = 'FROM' THEN FROM = 1                             
                                                                       
IF DATATYPE(EPOS) ?= 'NUM' | DATATYPE(SPOS) ?= 'NUM' THEN DO           
  ZEDLMSG = 'Specify numeric starting and ending columns to be deletet.'
  ADDRESS ISPEXEC "SETMSG MSG(ISRZ000)"                                 
  EXIT                                                                 
END                                                                     
IF EPOS - SPOS < 0 THEN DO                                             
  ZEDLMSG = 'Starting position greater then ending position !!!'       
  ADDRESS ISPEXEC "SETMSG MSG(ISRZ000)"                                 
  EXIT                                                                 
END                                                                     
                                                                       
ADDRESS ISREDIT "(LASTL)  = LINENUM .ZLAST  "                           
                                                                       
DO I = FROM TO LASTL                                                   
  ADDRESS ISREDIT "(CURRLINE) = LINE &I"                               
  LEFT    = SUBSTR(CURRLINE,1,SPOS-1)                                   
  RIGHT   = SUBSTR(CURRLINE,EPOS+1)                                     
  NEWLINE = LEFT||RIGHT                                                 
  ADDRESS ISREDIT "LINE &I = (NEWLINE)"                                 
END                                                                     

EXIT


O.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 27, 2006 5:42 am    Post subject:
Reply with quote

bvanilkumar,

I forgot that edit ignores spaces in this case. What I've done is change the spaces in the range you're woking in to a printable char (I use ~)
then do as I suggested.

I tried it and it works. Are you sure you're using '' and NOT 'b' (where b is a space)?.

Just enter c all 5 9 'b' '~' before you enter the cmds I suggested yesterday.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Wed Dec 27, 2006 5:55 am    Post subject:
Reply with quote

Ofer said,
Quote:
And just to make it clearer, those are not TSO commands, they are ISPF edit command.


And "GDG versions" are GDG entries; "PDS PSs" are PDS members and "JCLs" is JCL to pick a few. Don't get me started, but I wish you luck on your quest. icon_smile.gif
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Dec 27, 2006 7:31 am    Post subject: Re: Any TSO command to delete a column or some columns of PS
Reply with quote

Pierre,

There are many ways to accomplish the problem at hand. I like to use 'BNDS' to do this type of manipulation also.

Since you brought it up first, How about giving a clear example, from start to finish how this would work with 'BNDS' ?

icon_smile.gif
Back to top
View user's profile Send private message
PeD

Active User


Joined: 26 Nov 2005
Posts: 456
Location: Belgium

PostPosted: Wed Dec 27, 2006 2:03 pm    Post subject: Re: Any TSO command to delete a column or some columns of PS
Reply with quote

Why not ! even if I prefer the person open the manual by himself.

suppose
Code:
****** ********************************* Top of Data **********************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000002 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000003 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000004 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000005 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000006 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
****** ******************************** Bottom of Data ********************************                                                     


Type on first command line
Code:
bnds01 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

to receive
Code:
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 =BNDS> <                                                                              >
 000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   

move the < sign at desired position here pos 5
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     

and using ((5 on from line and (( on last line, the file is modified. Then restore BNDS.

Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
((5001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000002 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000003 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000004 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000005 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
((0006 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   

finally
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
000001 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000002 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000003 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000004 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         

Save it and go to work...
Happy end of year
Cheers
Pierre
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Dec 27, 2006 9:24 pm    Post subject: Re: Any TSO command to delete a column or some columns of PS
Reply with quote

Good post Pierre,

Just a couple of additions,

?BNDS? can be controlled from the Primary command line also.

?BDNS 5 80? as a Primary Command would accomplish the same thing as using ?BNDS? as a line command.

?BNDS? as a primary Command will reset the bounds to their default values.
Back to top
View user's profile Send private message
bvanilkumar

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Thu Dec 28, 2006 2:10 pm    Post subject: Re: Any TSO command to delete a column or some columns of PS
Reply with quote

PeD wrote:
Why not ! even if I prefer the person open the manual by himself.

suppose
Code:
****** ********************************* Top of Data **********************************
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000002 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000003 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000004 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000005 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
000006 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     
****** ******************************** Bottom of Data ********************************                                                     


Type on first command line
Code:
bnds01 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE

to receive
Code:
 =COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
 =BNDS> <                                                                              >
 000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   

move the < sign at desired position here pos 5
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
000001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                     

and using ((5 on from line and (( on last line, the file is modified. Then restore BNDS.

Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
((5001 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000002 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000003 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000004 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
000005 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   
((0006 AAAA11111ABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                   

finally
Code:
=COLS> ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
=BNDS>     <                                                                          >
000001 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000002 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000003 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         
000004 AAAAABBBCCCCCCCCCCDDDDDDDEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE                         

Save it and go to work...
Happy end of year
Cheers
Pierre



Good post pierre, it really worked well.
I have never used this 'BOUNDS'.
What other things can be done with using 'BOUNDS'????

Thanks,
Anil Kumar BV
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 TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm
No new posts Fail to change physical VSAM filename... jacobdng CICS 7 Fri Jan 20, 2017 12:36 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm


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