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
 
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

Senior Member


Joined: 07 Feb 2009
Posts: 1072
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: 6970
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: 8620
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: 6970
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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts OUTREC with ALter Command scorp_rahul23 DFSORT/ICETOOL 1 Wed Nov 22, 2017 3:10 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm

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