[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference smaug::snagwy

Title:SNA GATEWAY NOTEFILE
Notice:Note 1.* -> kits and doc, 288.* -> obtaining product support
Moderator:EDSCLU::GARROD
Created:Fri Feb 07 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:7116
Total number of notes:28576

7002.0. "3270TPS as background job ?" by COPCLU::PALMANN () Wed Feb 05 1997 06:39

The "DEC/SNA 3270 Terminal/Print Service for OSF/1" manual tells how
to start a local session automatically on session manager startup. 

I have made the session definitions as shown below. It defines a local
session, and a HLLAPI address which is used by the atb-program in the 
local session command.

This works if the session manager is started as a foreground job, but if  the
session manager is started as a background job the session manager starts, 
without activating the local command. 

My problem is: how do you start the session manager local command as a
background job ??




#
#   Host (3270) Session Definitions
#

Host      # Start of Host Session Definition

# Keyword           Parameter      Description
# _______           _________      ___________
ShortName           B              # Short name of session
LongName            HOSTB          # Long name of session
Description         "ATB printerdriver"     # Descriptive comment
Engine              %peer%:0:0
DeviceID            185            # Logical Unit/Device No.
Model               4              # Display Size
ExtendedAttributes  enable         # Extended Data Stream

ComBufSize          3600
ComBufNum           1
D0Struct            enable
Interpret           enable
AutoAcknowledge     enable
LPIntercept         disable
;

#
#   Local (3270) Session Definitions
#

Local      # Start of Local Session Definition

# Keyword           Parameter      Description
# _______           _________      ___________
ShortName           b              # Short name of session
LongName            LOCALb         # Long name of session
Description         "ATB printer"  # Descriptive comment
Command             "/usr/users/manager/atb/atb sna=B tcp=192.168.1.60
port=4008
log=ATB.log"                                  # Program to execute
Directory           /usr/users/manager/atb    # Initial working directory
Multiple            enable                    # Enable multiple instances
;

		Jan

T.RTitleUserPersonal
Name
DateLines
7002.1Hmmm- did you try MS3279 variable?DELNI::BARBER_MINGOLet me DANCE for youTue Feb 18 1997 17:275
    Hi,
    	Did you try setting the MS3279 variable and running your program
    from the promt?
    Cindi
    
7002.2Well.. no. It's like thisCOPCLU::PALMANNFri Feb 21 1997 07:2385
Problem :

The local command is not executes, when start3270 is run as a background job.

Here is a log, over what happends when the application is started in 
the forground.

There has been made some changes to start3270.
# diff startatb start3270

195c195
< # read x
---
> read x
#

this is to prevent start3270 waiting at ' read x '

			-------------------------------

First in normal forground mode.


TPK.dsb.dk> startatb  ATB
$COMMLINK has been set to: /usr/commlink
$PATH has been set to:
.:/usr/users/manager/bin:/usr/bin:.:/usr/commlink/bin/327
0:/usr/commlink/bin/natlang:/usr/commlink/bin/slm:/usr/commlink/bin/sna:/usr/
c
om
mlink/bin/utl


HLLAPI Trace:  Return Code = 0
Time exited 14:28:52.

HLLAPI Trace:  Call to Function SET SESSION MODE (100)
Time entered 14:28:52
HLLAPI Trace: Session Mode or Status Mask ffcc
HLLAPI Trace:  Return Code = 0
Time exited 14:28:52.

HLLAPI Trace:  Call to Function READ SESSION DATA (103)
Time entered 14:28:52
HLLAPI Trace:  Buffer Size 3440


The program is then waiting on some data, from a system called SMART.
It's a printer driver.
The following ps-commands shows how the 
session manager is started, and the 
' 3270tps local command' is started with it's parameters.

TPK.dsb.dk> ps ax | grep ttyp4
24773 ttyp4    I        0:00.10 -ksh (ksh)
24806 ttyp4    I  +     0:00.01 xcp3270
24823 ttyp4    I  +     0:00.02 /usr/users/manager/atb/atb sna=B
tcp=192.168.1.
24844 ttyp4    S  +     0:00.09 xsm3270 /usr/commlink/adm/gems/sm3270.msg
24866 ttyp4    S  +     0:00.01 xti3270
24864 ttyp5    S  +     0:00.00 grep ttyp4


Here is then what happends, when the process is started is the background.

TPK.dsb.dk> nohup startatb ATB > /dev/null &
[1]     25058
TPK.dsb.dk>
[1] + Stopped(tty output)      nohup startatb ATB > /dev/null &
TPK.dsb.dk>
TPK.dsb.dk>

Here is the ps-commands again, showing that the '3270tpd local command' was 
not started.

TPK.dsb.dk> ps ax | grep ttyp4
24773 ttyp4    I  +     0:00.20 -ksh (ksh)
25048 ttyp4    T N      0:00.01 xti3270
25058 ttyp4    T N      0:00.09 xsm3270 /usr/commlink/adm/gems/sm3270.msg
25097 ttyp4    T N      0:00.01 xcp3270
25076 ttyp5    S  +     0:00.00 grep ttyp4



			Jan.
7002.3Try it to see if it works.DELNI::BARBER_MINGOLet me DANCE for youFri Feb 21 1997 13:5619
    Hi,
    	What I am trying to say is, when you define a local session
    interactively, it is the first session chosen/selected to
    be displayed.  If you are running the process in the background,
    there is no display, so they may not be invoking the program
    for you.  You can check with the CSC to get them to confirm
    this behavior with Apertus.  Local commands may require IO
    features that you might not have available when you run the
    program to the background (like displaying the promt).
    
    	In the interim, I am asking you to set the MS3279 variable
    yourself, and THEN run your desired command YOURSELF to make
    sure that the problem is JUST weather local commands are invoked
    on background sessions and not something more like the HLLAPI
    program not being able to process your information.
    If it works with the MS3279 definition, and your manual invocation
    of the program, then you will have a work around.
    
   Cindi
7002.4Still no go'COPCLU::PALMANNTue Mar 04 1997 03:458
    Hi Cindi,
    
    The customer set the MS3279 variable, and the 'local command ' is still
    no executed.
    Can you execute a command in the background with the MS3279 variable ?
    If so, could you please show me.
    
    				Jan
7002.5If only the manuals had some prober examples.COPCLU::PALMANNWed Mar 05 1997 07:15223
When he MS3279 environment is defined, and the session manager is executed
as a foreground process.

Everything is working perfectly well.
Example:

TPK.dsb.dk> MS3279=ATB ; export MS3279



TPK.dsb.dk> env
COMMLINK=/usr/commlink
PATH=.:/usr/users/manager/bin:/usr/bin:.:/usr/commlink/bin/3270:/usr/commlink/
bi
n/natlang:/usr/commlink/bin/slm:/usr/commlink/bin/sna:/usr/commlink/bin/utl
NLS_LANG=american_america.we8iso8859p1
LOGNAME=manager
MS3279=ATB
GWSOURCE=telnet
ORA_NLS=/ocommon/nls/admin/data
USER=manager
SHELL=/bin/ksh
HOME=/usr/users/manager
TERM=vt100
PWD=/usr/commlink/bin/3270
TPK.dsb.dk>



TPK.dsb.dk> pwd
/usr/commlink/bin/3270
TPK.dsb.dk>




TPK.dsb.dk> start3270 ATB


               3270 Session Manager
                  DEC SNA for OSF/1

A work based on SSI products.

Copyright (c) Systems Strategies Inc., 1989, 1994
All Rights Reserved

Restricted Computer Software as defined in the Rights in
Data General Clause at FAR 52.227; and as applicable

Use, duplication, or disclosure by U.S. Government is
subject to restrictions as set in Subparagraph (c) 1  (ii)
of the Rights in Technical Data and Computer Software
Clause at DFARS 252.227-7013.

[Press RETURN to Continue]





Screen is cleared !!!!




HLLAPI Trace:  Return Code = 0
Time exited 9:57:30.

HLLAPI Trace:  Call to Function SET SESSION MODE (100)
Time entered 9:57:30
HLLAPI Trace: Session Mode or Status Mask ffcc
HLLAPI Trace:  Return Code = 0
Time exited 9:57:30.

HLLAPI Trace:  Call to Function READ SESSION DATA (103)
Time entered 9:57:30
HLLAPI Trace:  Buffer Size 3440




Now the local command is executing !!!
ps from another terminal shows:
TPK.dsb.dk> ps
  PID TTY      S           TIME COMMAND
 2809 ttyp2    I        0:00.15 -ksh (ksh)
 2866 ttyp3    S        0:00.17 -ksh (ksh)
 2939 ttyp3    S  +     0:00.08 xsm3270 /usr/commlink/adm/gems/sm3270.msg
 2959 ttyp3    S  +     0:00.01 xti3270
 2960 ttyp3    S  +     0:00.01 xcp3270
 2961 ttyp3    S  +     0:00.02 /usr/users/manager/atb/atb sna=B
tcp=192.168.1.
 2964 ttyp4    S        0:00.09 -ksh (ksh)

Notice the local command pid 2961 is executing !!

Terminating the process with ctrl/c returns to the session
manager main menu !!





CP-MM00           SNA-3270-TPS               3270 Control Mode

                                   Main Menu

                        1. Session List

                        2. Session Control

                        3. Local Command

                        4. File Transfer

                        5. Keyboard Mapping Report

                        6. System Administration


                        Current Session...: -



#> 6

ESC=Cancel  *=CurrentSession
CP-SA00           SNA-3270-TPS               3270 Control Mode

                           System Administration Menu

                1. Stop 3270 Session Manager

                2. Display 3270 Session Manager Information

                3. List HLLAPI User Programs

                4. Reset 3270 Session Manager

                5. Display System Error Information









Notice: 3270 Session Manager terminating...
ESC=Cancel
TPK.dsb.dk>


------------- Here is the problem -- ( MS3279 made no diference ) --------

Now we execute the process in the background !!!!
We use an edited version of start3270 to startup the session
manager because the original version includes a read command.
The differences is as follows:

TPK.dsb.dk> diff start3270 startatb
173,175c173,175
< Tput clear
< echo
< echo "               3270 Session Manager " 1>&2
---
> # Tput clear
> # echo
> # echo "               3270 Session Manager " 1>&2
193,195c193,195
< bannerssi
< echo "[Press RETURN to Continue] \c"
< read x
---
> # bannerssi
> # echo "[Press RETURN to Continue] \c"
> # read x
TPK.dsb.dk>

The changes removes input and output from the startup script !!!

-------------- Ok here we go with a background job ( & ) --------

TPK.dsb.dk> startatb ATB &
[1]     3017
TPK.dsb.dk>
TPK.dsb.dk>
[1] + Stopped(tty output)      startatb ATB &
TPK.dsb.dk>
TPK.dsb.dk>
TPK.dsb.dk>
TPK.dsb.dk>
TPK.dsb.dk>
TPK.dsb.dk>
TPK.dsb.dk> ps
  PID TTY      S           TIME COMMAND
 2809 ttyp2    I        0:00.15 -ksh (ksh)
 2866 ttyp3    S        0:00.26 -ksh (ksh)
 3017 ttyp3    T N      0:00.06 xsm3270 /usr/commlink/adm/gems/sm3270.msg
 3033 ttyp3    T N      0:00.01 xti3270
 3034 ttyp3    T N      0:00.01 xcp3270
 2964 ttyp4    I  +     0:00.10 -ksh (ksh)

Notice the local command is not started !!


-----------------------------------------------

Questions :

1) Is it posible, at all,  to run local commands from the session 
   manager in the background ??

2) ARE we doing the startup the right way ??
   (There is no examples in the manual)

3) Do you have any example ??


			Jan
7002.6Different definition and purpose for the local session.DELNI::BARBER_MINGOLet me DANCE for youWed Mar 05 1997 10:1528
    Hi,
    	When I worked there, local sessions were often considered EXPRESSLY
    for interactive use.  They were designed to give you access
    to the U*x terminal, while your 3270 process was running.
    	When you are running the 3270 processes in the background,
    you ALREADY HAVE access to the U*x terminal.  Therefore, it's 
    redundant to spawn a local session, to give you access to a 
    terminal that you already have access to.  You set the MS3279
    variable to let your terminal know where to go, and THEN you
    spawn your 3270 process in the background.  THEN try to run
    your "local session" command by hand at the resident terminal
    you never lost control of because you backgrounded your 3270
    terminal.
    
    If that works, that is your work around.
    ============
    
    Contact your customer support center to ask them to spawn
    local processes from the background.
    
    As I understand it, you were using the local sessions to invoke
    your programs in "batch" and not JUST to give you access to
    your typing terminal (as most Local sessions are designed).
    
    Luck,
    Cindi
    
    
7002.7Try the work around, then go to the CSC.DELNI::BARBER_MINGOLet me DANCE for youWed Mar 05 1997 10:5415
    Hi,
    	When you try the work around, you may see an error stating:
    
    Cannot select from dynamic local session
    
    	This would indicate you are trying to run a verb on a non
    named local session. If you get the same message, contact your CSC, 
    and explain to them that your local commands from named sessions won't start, and you
    can't get your program to run at your command prompt because
    it is being viewed as a dynamic local session. (The demo hllapi
    programs located in $COMMLINK/demo/3270 all function, but they
    are using verbs that must be run from a named local session).
    
    Luck,
    Cindi
7002.8It's geting complicatedCOPCLU::PALMANNThu Mar 06 1997 06:3617
Hi,
I read your answer a couple of times, and still have problems understanding 
it. Still I will read it again...

Here is our situation in a nutshell 

We are to use the 3270tps as a HLLAPI interfase to a printer driver.
We are to communicate via HLLAPI commands to the IBM, to recieve data to the
printers on our system. 

We have 40 printers, and need 40 3270tps sessions started.
Since we can not have 40 windows running on our computer, each with there
own 3270 tps, we need to put the 3270tps jobs in the background.

			any comments ?  :v)

				Jan
7002.9Ok- one more try.DELNI::BARBER_MINGOLet me DANCE for youThu Mar 06 1997 13:0232
    Hi,
    	We'll try one more time, and then you'll go to the CSC.
    
    You need to spawn 40 background processes, or 1 process with 40
    sessions to different engines.
    
    You wish to run hllapi programs on the 40 sessions in the background.
    
    The MS3279 variable is supposed to be set to the name of the
    shared memory segment controlling your session manager(s).  With
    that variable set, hllapi programs have direction as to what
    session managers they are going to use to invoke their verbs.
    
    I am asking you to start your process in the background.
    Set your MS3279 variable to your disk, directory, and file name
    of your shared memory segment for your session manager.  Then,
    from the same terminal where you started your background process,
    try to invoke your hllapi program.  If that works, then your
    solution will be to write a script that performs this sequence
    40 times.  That is the work around you can try after you log
    your call to the CSC, asking if you can get named local sessions
    to spawn on the background.
    
    If ALL else fails, you can start ONE session manager, with 40
    sessions in it.  Then you can spawn attaches to those 40 sessions
    from ONE window, from your interactive local session.
    
    Hope that's clear,
    If it isn't, log your call,
    The CSC should be able to clear
    it up for you,
    Cindi