How to use space without deleting text when editing a dataset - mainframe

I am editing datasets on a mainframe via x3270. However I cannot figure out how to move text forward, I simply just want to be able to move text forward when pressing space without deleting any characters. How?

If the line you are trying to shift has trailing spaces then I would expect you to be able to insert spaces with no issues. If for some reason you have hex data such as X'0A' in your data then this could prevent you being able to insert. For instance
/* data */ hi
65488A8456044448844444
1C041310C1A00008900000
In the above you could not insert anywhere prior to the X'0A'. However you could insert in front of 'hi'. Check the hex values on the line where you are trying to insert characters.

I read elsewhere that there is a setting in x3270 to let x3270 treat trailing blanks as nulls, thus enabling the insertion of characters even when ISPF editor is set to nulls off. Look at x3270 menu "Options -> Toggle -> Blank Fill". See here x3270 blank fill
If this setting is not enabled, then x3270 is behaving as expected with respect to trailing spaces and insert mode: You can't shift trainling blanks. You need to set nulls on in ISPF editor command line. See NULLS ISPF editor command. Note that this setting is per ISPF editor profile. ISPF editor keeps one profile per RECFM and low level qualifier.

Related

Any ideas on how to format these lines in vim?

I have the following lines that I've already formatted quite a bit, but I can't seem to figure out how to format these jagged lines so they are all in the correct position. I've been trying using macros and also using /s but it just seems the tabs or spaces after the word is a bit different for each. What might be a good way to format this here?
You can select the entire part you want to format and then use the normal command
'<,'>s/\([^: ]\+\)[ ]*:[ ]*\([^: ]*\)/\=printf('%-8s%8s%s%8s%8s',submatch(1),' ',':',' ',submatch(2))/g
which will pad the result evenly around the :.
You can select in vim using v then enter normal mode with esc followed by entering command mode with :. Paste the above line in command mode once the selection is made and hit enter.
Use vim-easy-align. And Select the text you need to align. Input ga*:. Done.

How to insert a character when editing a file using ISPF Edit via TN3270?

The editor in mvs3.8 TK4- is very different from the editors that I have used in Windows and Linux. I am trying to figure out how to insert a character between two characters in the editor. For example:
//HERC01C JOB (COBOL),
If i want to insert an O after C to //HERC01CO JOB (COBOL), the only ways i can do are by backspacing from the end of the line upto C and type everything after that again; or by moving all the characters to a position to the right using )1 command and the typing over everything form the beginning till C. Is there a way to add O here after C so that it will insert O and automatically move all the characters after that one place to the right?
I am presuming you are using the ISPF editor
enter nulls on in the command line. This will convert trailing spaces to nulls
if the line is full, you will need to split it
position cursor where you want to enter the new character
Make sure you are in insert mode the insert key swaps between insert and over-write modes.
Type the character.

How to remove invisible line break character

I have big data at excel, and some cells contains html codes. These cells have line breaks in them. I tried to replace line breaks (Alt+010, \n) but excel said there is no char like this.
When I copied cell to notepad, there is no line break.
When I copied from notepad to phpmyadmin sql area or textpad, I see line breaks again.
There are notepad, textpad and phpmyadmin sql area screenshots below. How can I remove these invisible line breaks?
This could be a problem with Carriage Return + Line Feed. When you press Alt+Enter in Excel it only incerts a Line Feed. But if you somehow get both Carriage Return + Line Feed in a cell that could leed to additional problems. See this page for solutions:
https://www.ablebits.com/office-addins-blog/2013/12/03/remove-carriage-returns-excel/
Did you try to remove any unnecessary tab within the code? Also check for some trivial things like e.g string max length in your mysql database or editor's miscellaneous settings.
EDIT. oh, I forgot. It may be also caused by your language settings, check for default database's regional coding preset and if Turkish is currently supported.
Line breaks - do you mean the line breaks you could introduce in Excel with ALT+ENTER?
Then you could use Search / Replace option in Excel without need to copy your content to another tool:
Open it and introduce in Search for CTRL+J (you will receive a point displayed in the search field).
In Replace you could introduce what you want (nothing, a space, a semicolon, ...).
Select Replace all.
EDIT:
I've tested it by copying html from textpad to one cell using clipboard. With this the method described by me is not working.
But there is another solution: Open replace command, for "search string" introduce ALT-Key (keep it pressed), then introduce by using the numeric key pad (on the right side of a "standard" keyboard) the tree digits 0 1 0 and finally release ALT-Key (you will see a point displayed in the search field). Choose as replacement string what you want and choose replace all.
Function =clean() helped me. Find/replace with ALT+J worked to replace, but did not fully deleted all the invisible characters in the string, so the cell was still misbehaving with text in columns. The =clean() function finally removed all the invisible characters left there.

Vim real tab characters start at column 8- I can't move all the way left

I'm using real tab characters in my files, and when whitespace characters are set to invisible (which it is by default), then the farthest left I can go is column 8. But if I make whitespace visible (:set list!) then it still says that I'm at column 8, but it at least shows my cursor all the way to the left. What could be causing this?
This is not a matter of correct or incorrect. Vim just chooses to put the (single cell) cursor on the last cell of the Tab, and the jumping forward movement probably makes Tabs easier to detect, so most people like that behavior. Only with :set list, where a Tab is represented by a start and follow-up characters does this change.
If you really can't get used to it, the only workaround (short of modifying Vim's source code directly) is:
set list listchars=tab:\ \ " Note: trailing space after the last backslash!
Note that this has other side effects, e.g. when soft wrapping words.
It's not a bug or a problem, other than a visual annoyance. In the upper screenshot your cursor is at first character of the line. Try a character modifying command like rx on it, you'll see.

vim: highlight words in visual block mode

Below is a screenshot of me entering visual block mode and pressing "w" to select by word:
How can I select every word in the rows I have selected? Meaning I want the full word in the rows highlighted instead of it getting cut off as shown in the screenshot.
edit: What I want to be able to do is delete a column of words of varying length. In the example screenshot I want to delete the words between the tags, But it could be any column of words.
There are a bunch of plugins for multiple selection, look them up on vim.org.
But I must remind you that visually selecting text is more often than not an unnecessary step. Why don't you explain what you actually want to achieve instead of your failed attempts? Maybe there's a better way...
[edit]
:'<,'>norm dit
seems to be the simplest way to achieve your goal without selecting every word:
and :,+7norm dit would be even better because you don't select anything.
The highlight modes can only select blocks (by cursor, by line, or by rectangular block). You can use a plugin such as vim-multiple-cursors to do what you are trying to do.
The only place where Vim allows a non-rectangular, "jagged edge" visual selection is at the end of the lines, i.e. by extending the blockwise selection with $. Therefore, you'd need to (temporarily) get rid of the trailing </th> (or include it in the selection, but operate in such a way that they are kept intact).
You shouldn't need a selection to work with the text. For example, to delete the text inside the tags, you can use a substitution:
:%s#<th>\zs.*\ze</th>##
You can't. You can only select rectangular blocks in block select mode. Maybe a plugin solves this?

Resources