IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem with VIIF service


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Voytovich Oleg

New User


Joined: 13 Nov 2007
Posts: 2
Location: Chelyabinsk, Russia

PostPosted: Thu Nov 15, 2007 6:53 pm
Reply with quote

Hi!

I try to write a wrapper around an ISPF VIIF service in C++. But it crashes every time when I use it. This is a my example of using VIIF in C.

Code:

extern "OS_UPSTACK" int ISPLINK(char*, ...);

extern "OS_UPSTACK" int viif_read_routine(char **dataptr, unsigned int *lenptr, unsigned int *request, void *dialog_data_ptr)
{
    static int j = 0;
    char buffer[128];
    if (j < 10)
    {
        memset(buffer, ' ', sizeof(buffer));
        sprintf(buffer, "Line %d", j++);
        *dataptr = buffer;
        return 0;
    }
    else
    {
        j = 0;
        return 8;
    }
}

...

int main(int argc, char* argv[])
{
    int rc = 0;
    ...
       
    unsigned int iRecordLength = 72;
    void *read_function_ptr = (void *)&viif_read_routine;

    ISPLINK("CONTROL ", "ERRORS  ", "RETURN  ");
    ISPLINK("CONTROL ", "LE      ", "ON      ");

    /* Invoke ISPF View */
    rc = ISPLINK("VIIF ",
        "        ",             /* data-name, used for recovery and title */
        "VIIFPROF ",            /* profile name */
        "F       ",             /* record format */
        &iRecordLength,         /* record length */
        &read_function_ptr,     /* read routine pointer */
        "        ",             /* command routine pointer */
        "        ",             /* dialog data */
        "        ",             /* edit length */
        "        ",             /* panel */
        "        ",             /* no macro */
        "        ",             /* format name */
        "        ",             /* sbcs or dbcs */
        "NO      ",             /* recovery is disable */
        "        ",             /* parameters for macro */
        "        ");            /* write routine pointer */

    ISPLINK("CONTROL ", "LE      ", "OFF     ");
    ISPLINK("CONTROL ", "ERRORS  ", "CANCEL  ");

    printf("VIIF return %d\n", rc);

    ...

    return rc;
}


Do anybody know where I make mistake?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Fri Nov 16, 2007 12:55 am
Reply with quote

Have you tried to run it with dialog test (3.7 in my main menu) or with ISPVCALL?

O.
Back to top
View user's profile Send private message
Voytovich Oleg

New User


Joined: 13 Nov 2007
Posts: 2
Location: Chelyabinsk, Russia

PostPosted: Fri Nov 16, 2007 11:27 am
Reply with quote

ofer71 wrote:

Have you tried to run it with dialog test (3.7 in my main menu) or with ISPVCALL?

O.


You cannot use command procedures, like ISPEXEC, to invoke VIIF service. Only ISPLINK allowed. I can't use dialog test to test it.

I suspect that service parameter list or dialog supplied functions format wrong. ISPF Services Guide (for z/OS 1.8) describe VIIF parameters like:
Quote:

CALL ISPLINK (’VIIF ’, [data-name], profile-name, rec-format, rec-len, read-routine, [cmd-routine], [dialog-data], [edit-len], [panel-name], [macro-name], [format-name], [’YES ’|’NO ’], [’YES ’|’NO ’], [parm-var] );

but this document http://www-1.ibm.com/support/docview.wss?uid=isg1OA20139 deny preceding. In any case, all my attempts to call VIIF service lead to abend.

When I wrote BRIF service wrapper I observed something similar. In that case my dialog supplied function did not conform OS linkage (extern "OS_UPSTACK") and I did not call ISPF Language Environment support for BRIF.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts How to avoid duplicating a CICS Web S... CICS 0
No new posts z/vm installation problem All Other Mainframe Topics 0
No new posts Job scheduling problem. JCL & VSAM 9
No new posts Problem with IFTHEN=(WHEN=GROUP,BEGIN... DFSORT/ICETOOL 5
Search our Forums:

Back to Top