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
 

 

Command to delete the columns in a flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Command to delete the columns in a flat file
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

Active Member


Joined: 07 Feb 2009
Posts: 984
Location: Oostende, Belgium

PostPosted: Fri Aug 28, 2009 4:01 pm    Post subject:
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    Post subject: Reply to: Command to delete the columns in a flat file
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    Post subject:
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    Post subject: Re: Reply to: Command to delete the columns in a flat file
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

Senior Member


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

PostPosted: Fri Aug 28, 2009 4:25 pm    Post subject:
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    Post subject: Reply to: Command to delete the columns in a flat file
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: 8593
Location: Back in jolly old England

PostPosted: Fri Aug 28, 2009 4:55 pm    Post subject:
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    Post subject:
Reply with quote

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

Senior Member


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

PostPosted: Fri Aug 28, 2009 5:11 pm    Post subject:
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    Post subject: Reply to: Command to delete the columns in a flat file
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    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Fri Aug 28, 2009 6:13 pm    Post subject:
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    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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
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 File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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