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

Command to delete the columns in a flat file


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chintu687

New User


Joined: 06 Aug 2009
Posts: 7
Location: Hyderabad

PostPosted: Fri Aug 28, 2009 3:20 pm
Reply with quote

Hi,

Can any one please suggest what is the command used for deleting required columns in a flat file. EX: A flat file with the length of 80 and i want to change the columns from 5-10 to 70-80. (or) i want to delet the columns 5-10. Thanks for your time.


Thank you,
chintu
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Aug 28, 2009 4:01 pm
Reply with quote

There is no command to interchange columns and if you want to delete columns 5-10, you might be able to use

Code:
c p'======' '' 5 all'
but if the following columns contain spaces, that's likely to screw up.
Back to top
View user's profile Send private message
chintu687

New User


Joined: 06 Aug 2009
Posts: 7
Location: Hyderabad

PostPosted: Fri Aug 28, 2009 4:18 pm
Reply with quote

Robert, the command is not working.
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Fri Aug 28, 2009 4:20 pm
Reply with quote

To delete columns 5 to 10 I would go about it this way. First turn columns on with the cols command. Then turn boundaries on by entering BNDS on the first line. Then put a less than "<" sign on column 4 and a greater than sign ">" in column 80. Then to test put "(6" on the data line. This should move all data left 6 characters but keep the first 4 characters. If your happy with the result enter the block shift commands "((6" on first line and "((" on last line. Save if you're happy.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 28, 2009 4:21 pm
Reply with quote

chintu687 wrote:
Robert, the command is not working.


Which command? I want money! or Do this for me!
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 28, 2009 4:25 pm
Reply with quote

Suggest you show us the "input" and expected "output" from that.
Back to top
View user's profile Send private message
chintu687

New User


Joined: 06 Aug 2009
Posts: 7
Location: Hyderabad

PostPosted: Fri Aug 28, 2009 4:52 pm
Reply with quote

Thanks...
The solution works fine...

To delete columns 5 to 10 I would go about it this way. First turn columns on with the cols command. Then turn boundaries on by entering BNDS on the first line. Then put a less than "<" sign on column 4 and a greater than sign ">" in column 80. Then to test put "(6" on the data line. This should move all data left 6 characters but keep the first 4 characters. If your happy with the result enter the block shift commands "((6" on first line and "((" on last line. Save if you're happy.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Aug 28, 2009 4:55 pm
Reply with quote

I'm still bemused as to why prino's solution didn't work. It's something I use a lot of the time

Wierd .................. icon_eek.gif
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Fri Aug 28, 2009 4:55 pm
Reply with quote

It's a pleasure.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 28, 2009 5:11 pm
Reply with quote

May be he had "spaces" in those columns.
Back to top
View user's profile Send private message
chintu687

New User


Joined: 06 Aug 2009
Posts: 7
Location: Hyderabad

PostPosted: Fri Aug 28, 2009 5:18 pm
Reply with quote

Donevin,

The below command is also working fine..

C ALL p'¬' '' 5 10 --> it deletes the columns from 5 to 10.

But my question ,is there any difference b/w the way you suggested and the above command?


Thank you,
chintu687
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Fri Aug 28, 2009 5:43 pm
Reply with quote

I don't see any difference except that my way is much longer than what you posted. So I'd use the shorter solution.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Fri Aug 28, 2009 5:46 pm
Reply with quote

typical missuse of words.

to delete columns means to shift data left or right.

to chg the values of data contained between columns is a much different thing.
Back to top
View user's profile Send private message
donevin

New User


Joined: 07 Jun 2005
Posts: 70
Location: South Africa

PostPosted: Fri Aug 28, 2009 6:10 pm
Reply with quote

Yeah Dick, that's how I interpreted the post (to shift the columns) but the other command (C ALL p'¬' '' 5 10) yields the same results.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Fri Aug 28, 2009 6:13 pm
Reply with quote

Agree with Dick -- that's why I asked show us the "input" and expected "output" from that.

There is other thread which asks to remove "," and when data gets shifted to left -- a set of good arguments follows... icon_biggrin.gif
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 Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts DELETE SPUFI DB2 1
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top