DanR Posted May 3, 2016 Report Share Posted May 3, 2016 Hi, I am running a macro where I need to validate something before proceeding to the next phase. The next step depends on whether there is a certain l etter in the field. the issue is when the cursor is on top of the character it wont copy using the copy command or even using control+c. example: tab , tab, " copy field " If the letter I is there remove it, if not proceed to next field and so on... Quote Link to comment Share on other sites More sharing options...
Cory Posted May 3, 2016 Report Share Posted May 3, 2016 It sounds like you're using a terminal emulator in Windows, correct? I mean MEP doesn't run in AS400. Quote Link to comment Share on other sites More sharing options...
DanR Posted May 3, 2016 Author Report Share Posted May 3, 2016 I GUESS SO. iT DOESNT RUN IN THE PROGRAM BUT USING THE KEYBOARD FUNCTION I AM TRYING TO DO DATA ENTRY. IT DOESNT RECOGNIZE WHEN THE CURSOR IS OVER THE LETTER. IF IT WERE ANOTHER PROGRAM, SAY EXCEL, IT CAN READ IT. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 3, 2016 Report Share Posted May 3, 2016 I used to do a lot of macros in TEs. You have to understand that originally users on systems like AS400 didn't use desktop computers. They had devices called a "terminal" that was just a display and keyboard usually connected to the server via RS232 serial port. What we used to do, and this was 2 decades ago, was to use the serial port on a desktop computer and employ a terminal emulation software. Of course there are many different ways this can happen and I think the first thing you have to consider is what TE software you're using. I think As/400 uses TN5250 but I'm not sure. That's the data stream protocol. And then which emulator is interpreting it and displaying it for you. It could be any one of dozens. And some are even web based. So I doubt anyone here can tell you how to address this problem until we can establish what program MEP is interacting with. It's like asking me how to change the spark plugs on "Engine". Well what kind of engine? What kind of car? So you should probably look into that first. But I can guess that you're probably running into the way the characters are being echoed to the screen. Like I know in some systems when you see a flashing background cursor the system is often switching back and forth the characters. Of the way the data is displayed is optional. For instance you might be able to turn off the flashing cursor. I think your solution might lie in these settings. But again we don't know what application it is and it's highly unlikely that anyone here knows this application. You might try getting some support from the program vendor or a user group for it. Now when I had issues like this I'd actually collect the entire screen to the clipboard and then scrape the data out of it. That might work for you also. But really I'm just guessing. Again hard to give advice when we have no idea what program we're dealing with. So let us know what program MEP is interacting with then maybe we can have some new ideas. Some screen shots might be helpful also. Quote Link to comment Share on other sites More sharing options...
rberq Posted May 3, 2016 Report Share Posted May 3, 2016 Now when I had issues like this I'd actually collect the entire screen to the clipboard and then scrape the data out of it. That might work for you also. The last "AS/400" I used was named the iSeries, and the IBM emulator was called iSeries Access. It used the TN3270 protocol sort of under the covers, as did other vendors' 5250 emulators. Who knows, IBM may have renamed iSeries to something else by now. I don't recall having your specific problem copying fields. However it often was easier to use Cory's technique of grabbing the whole screen, then extracting the needed data. Using other methods, like tabbing around the screen, would screw up cursor positioning and upset the user. For analysis purposes, do the following MANUALLY (not using ME at all): (1) get the screen set up as your macro will be working with it, including a letter in the field you are having issues with. (2) type Ctrl-a and see if it highlights the whole screen. (3) Ctrl-c to copy to clipboard. (4) Paste the clipboard into Notepad and see what you have. If you can see the field(s) you want, then you can figure out how to pick them up with a macro, probably by pasting the clipboard into a ME variable, searching for [the location of] the label field that precedes the needed data, and based on that location copy the data field to another ME variable. If you have a hex editor it might help you, because the copied screen may contain unprintable characters, but you probably won't have to go that far. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 4, 2016 Report Share Posted May 4, 2016 RBerg, you OLD dog. LOL. Seems we had some similar experiences. Lemme see if I can date myself. I cut my teeth on a Digital VAX/VMS 8600. So am I older or younger? Danner: I would also add that if you do screen scrapes and find is difficult to isolate your text ask me to introduce you to something called Regular Expressions. It was born to extract text from stuff like this. I use it a lot in my web scraping. And I could make you a little tool to do it for you that you can drive from MEP. Basically it does much the same thing that RBerg was describing but it's an engine that was developped a million years ago to do exactly this. I have wasted hundreds of man hours searching and extracting data and then I found RegEx does is all and a bit more. IN fact I've been thinking about starting an addon for MEP for RegEx. Might be a good time to start it. Oh, RBerg, Do you remember ProComm? Quote Link to comment Share on other sites More sharing options...
acantor Posted May 4, 2016 Report Share Posted May 4, 2016 In some non-standard screens running under Windows, pressing Alt + spacebar may reveal program features that are otherwise difficult or impossible to access. For example, in the Windows Command Prompt, Alt + spacebar opens the System menu, which includes "Edit," which makes it possible to "Mark" a selection, and "Copy" and "Paste" it. Quote Link to comment Share on other sites More sharing options...
rberq Posted May 4, 2016 Report Share Posted May 4, 2016 RBerg, you OLD dog. LOL. Seems we had some similar experiences. Lemme see if I can date myself. I cut my teeth on a Digital VAX/VMS 8600. So am I older or younger? Gee, Cory, I don’t know, it sounds like you were still riding your tricycle when I started with computers in college in the late 1960s. The only VAX I worked with was in the 1990s and I was surprised to find it was a real computer. I started with IBM mainframes so anything smaller than 40 refrigerators was just a toy, and that attitude died hard with me. We got rid of our last mainframe in 2007 and it was down to the size of a college dorm icebox; even the AS/400 “midrange” machine was bigger. Around that time I spent a few years using ME to do screen-scraping and pasting among Citrix server, AS/400, and mainframe applications. We had between 300 and 500 ME licenses active every day. I’m a hard core ME3 user – ME Pro was too new and bug-ridden when I tried to convert our functions, and a lot of macros turned out to DEPEND ON the limitations of ME3. AS/400 was overall a good machine to program but paradoxically one of the tougher terminal emulators to integrate ME with. I have used ME for many years as a productivity tool -- I always told my managers it was worth half a person in time and efficiency improvements. Sorry to subject the rest of you to this dissertation, but us old f*rts have to reminisce. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 4, 2016 Report Share Posted May 4, 2016 Not even! I didn't get into that Digital until 1986 in college. I too have dealt with several mainframes like this. ProComm had a scription part I used a lot in place of old Wyse terminals. One thing that was nice about ProComm was you could tap into the serial data stream and even echo it to a file. The trick in this case is to find something like this for Danner. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.