Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Problem with VIIF service

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Problem with VIIF service
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: 2360
Location: Israel

PostPosted: Fri Nov 16, 2007 12:55 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts RDz Json restful service Kevin Vaz IBM Tools 4 Thu Jun 29, 2017 10:44 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us