Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shrink a dataset to smaller column length

Status
Not open for further replies.

leo6

Programmer
Mar 2, 2005
22
US
Hi ,

Can a dataset file be shrinked by removing data between specific column locations using REXX in Mainframes?
For eg.,consider a dataset having 4 records as ,

abc defghijklmnopqrs
abc defghijklmnopqrs
abc defghijklmnopqrs
abc defghijklmnopqrs

I would like to have the output file as ,

abcdefghijklmnopqrs
abcdefghijklmnopqrs
abcdefghijklmnopqrs
abcdefghijklmnopqrs

obtained after removing the space characters in column 3 and 4 for all records of the file..
Is it possible using overlay() function ?
Kindly advice.
 
Not OVERLAY(), but you can parse and reconstruct:
Code:
parse var line front 4 middle 6 back /* abc .. defgh */
middle = Space(middle,0)   /* disappears if blank */
line = front || middle || back  /* abcdefgh */

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Frank, wouldn't Space do it regardless of the position of the blank? line = Space(line, 0)
 
It would if you wanted all spaces removed wherever they were in the line. The original spec wanted only columns 3 and 4 reduced. What that means is that my solution is also incorrect. It should be:
Code:
parse var line front [b]3[/b] middle [b]5[/b] back /* abc .. defgh */
middle = Space(middle,0)   /* disappears if blank */
line = front || middle || back  /* abcdefgh */
although I actually think the OP meant columns 4 and 5...

Frank Clarke
Tampa Area REXX Programmers' Alliance
REXX Language Assn Listmaster
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top