1

I have an interesting problem interfacing to an IBM mainframe based CICS application. I can login and write to input fields successfully using s3270 and x3270if. However, the CICS system I am working with expects certain commands to simply be written to the "screen", not a proper input field. I am using the String() function to write to input fields, but I cannot seem to find a function that will simply write a string to a given screen position.

Has anyone dealt with a similar scenario and can provide me with some pointers?

kaigoh
  • 500
  • 3
  • 11
  • Is the MoveCursor() function described in http://x3270.bgp.nu/Unix/x3270-script.html what you're looking for? – Valerie R Jun 08 '16 at 17:10
  • @ValerieR I've tried moving the cursor and then using String(), but apparently String() will only write text to an input field. I move the cursor, send the text that I want, then send the enter key, but the CICS application just throws an error. – kaigoh Jun 09 '16 at 07:55
  • You might want to get a dump of the incoming 3270 screen to verify that the row/column you are moving to aren't protected. Move/String should work so long as you're in an unprotected part of the screen. – Valerie R Jun 09 '16 at 15:46
  • One other thing...if you need to see the actual 3270 datastream, you can capture it either on the mainframe or your client. There are various mainframe traces that capture the 3270 datastream to a particular target, and on the client, you could always use something like Wireshark to see the traffic if it's not encrypted. Honestly, it's old technology, but I always found HLLAPI a better way to do this sort of thing - it gives you greater control over the various 3270 attributes (but you'd need an emulator supporting HLLAPI, and I don't believe there are any free ones out there). – Valerie R Jun 09 '16 at 15:53
  • I don't know the API you are using. But... is there any SendKeys() function available? – bitfhacker Jun 09 '16 at 17:31
  • When you say "written to the screen", possibly do you mean at position 1,1? That might be an input position if you are working in a pseudo-conversational environment that works by tran codes in the upper left. – zarchasmpgmr Jun 10 '16 at 23:45

1 Answers1

1

With 3270, there is no such thing as "write to the screen," as opposed to writing to a field. A formatted 3270 buffer is a set of fields, each with a certain set of attributes. You cannot write to an arbitrary screen position unless there is an unprotected field that includes that position. That's 3270 specs, that's how 3270 hardware worked, that's how 3270 emulators work, and any API you may be using for working with 3270 emulators will just expose that.

(You may have an unformatted buffer with 3270, but I gather that's not the situation you are facing, since then you would be able to write to any screen position - the buffer is essentially one big field.)

So you need to figure out how the screen you are trying to write to is formatted, and where its fields are, and where the application expects its input. If you can just run the emulation and type the input according to whatever instructions you have then it should be straightforward - wherever your input goes, that's where you should put it programmatically.

Yuri Steinschreiber
  • 2,528
  • 2
  • 10
  • 17