Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2007
    Posts
    49

    Unanswered: Unload View issue - z/oS DB2

    Hi All,

    I was trying to unload the view ( View is created as JOIN of two tables) using the UNLOAD card

    UNLOAD
    SHRLEVEL CHANGE
    UNLOADDN (SYSREC)
    CNTLCARDS DB2LOAD
    CNTLDDN SYSCNTL
    DISCARDS 0
    ORDER NO
    SORTDEVT SYSDA
    SORTNUM 1
    AUTOTAG NO
    INTERVAL 0
    FIXEDVARCHAR NO
    FORMAT STANDARD
    SELECT * FROM VIEWNAME

    I get the error as
    BMC51654I DIRECT YES IN EFFECT
    BMC50229E VIEW DEFINITION FOR VIEW "VIEWNAME" NOT SUPPORTED, REASON CODE = 2
    BMC50013I UTILITY EXECUTION TERMINATING, RETURN CODE = 8

    Can anyone help me in solving this error ??

    To mention when I have used DSNTIAUL utility to unload the same view data it worked.

  2. #2
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963

    Exclamation You can do it

    You can do this, using as argument SQL (select * from view_name)....

    Take a look on JCL:

    Code:
    //UNLOADV  EXEC PGM=IKJEFT01,DYNAMNBR=20
    ...............
    ...............
    ...............
    //SYSTSIN  DD *                                   
         DSN SYSTEM(system_name)                             
           RUN  PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) -    
               PARM('SQL')                       -    
               LIB('your_library')            
      END                                             
    /*                                                
    //SYSIN    DD *                                   
           SELECT * FROM View_Name   
            WITH UR;                                   
    /*

    Lenny

  3. #3
    Join Date
    Dec 2007
    Posts
    49
    Yes Lenny , Thanks for the information. But as I already mentioned using DSNTIAUL utility , I am able to unload the data from View. But I am getting the error when I use the other UNLOAD Card which I have pasted in my initial post.

  4. #4
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    Neharao, from the error message, it looks like you are using BMC to do the unload. BMC50229E Reason Code 2 is:

    The utility encountered an unsupported view definition for the reason code shown in this message.

    2 - Join Specified in View Subselect.

  5. #5
    Join Date
    Jul 2009
    Location
    NY
    Posts
    963

    Thumbs down

    Quote Originally Posted by Neharao View Post
    Yes Lenny , Thanks for the information. But as I already mentioned using DSNTIAUL utility , I am able to unload the data from View. But I am getting the error when I use the other UNLOAD Card which I have pasted in my initial post.
    You can't use UNLOAD card.

  6. #6
    Join Date
    May 2009
    Posts
    508
    Provided Answers: 1
    Neharao, It has been awhile since I used BMC but I think there is a DIRECT AUTO parameter that will automatically switch to a IBM unload (DSNTIAUL) and the unload should then work. If I remember correctly DIRECT YES forces the unload to only use BMC and it can't handle certain SQL syntax (like Joins).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •