MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Are the contents of SYSPACKSTMT in Unicode or EBCDIC?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database
View previous topic :: View next topic  
Author Message
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Jan 14, 2008 2:20 pm    Post subject: Are the contents of SYSPACKSTMT in Unicode or EBCDIC? Reply with quote

As of DB2 version 8, the contents of the SYSPACKSTMT (and the SYSSTMT) catalog tables could contain rows which are either UNICODE or EBCDIC characters, depending on when the package was last bound and which version of DB2 the package was bound under. A package bound under version 7 of DB2, when re-bound, will cause the contents of the STMT column on the SYSPACKSTMT table to be changed from EBCDIC to UNICODE.

My real question is:
Is there a way to determine whether the STMT column of the SYSPACKSTMT table contains UNICODE or EBCDIC characters without looking at the contents of the STMT column?

Is there some way to determine this by querying the system catalog or even within the contents of the STMT column itself?
Back to top
View user's profile Send private message
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Jan 14, 2008 2:44 pm    Post subject: Reply with quote

I just got my answer from my DBA who went to IBM to get a response. It's fairly long, so I'll try to filter through the information and provide a readable post. Very Happy
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12376
Topics: 75
Location: San Jose

PostPosted: Mon Jan 14, 2008 2:44 pm    Post subject: Reply with quote

jim haire,

Try this

Code:

SELECT CAST(SUBSTR(T1.STMT,48,1) AS CHAR(1) CCSID EBCDIC
            FOR SBCS DATA) AS DBRMMRIC,
       CAST(SUBSTR(T1.STMT,47,1) AS CHAR(1) CCSID EBCDIC
            FOR SBCS DATA) AS DBRMPDRM
  FROM SYSIBM.SYSPACKSTMT T1, SYSIBM.SYSPACKAGE T2
  WHERE T1.COLLID = 'EXAMPLE_COLLECTION'
    AND T1.NAME   = 'EXAMPLE_PACKAGE_NAME'
    AND T1.COLLID = T2.COLLID
    AND T1.NAME   = T2.NAME
    AND T2.TYPE   = ' '
    AND T1.SECTNO = 0
    AND T1.SEQNO  = 0
    AND T1.STMTNO = 0;

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Jan 14, 2008 2:52 pm    Post subject: Reply with quote

Kolusu,
That is very similar to what I was sent. I will try both. Thanks for the quick response!
Back to top
View user's profile Send private message
jim haire
Beginner


Joined: 30 Dec 2002
Posts: 140
Topics: 40

PostPosted: Mon Jan 14, 2008 3:18 pm    Post subject: Reply with quote

Based on the brief reading I've done and Kolusu's response, here is the additional information you need to look for.

If the DBRMMRIC (48th character of the STMT column) is less than or equal to "K",
the STMT column will be in EBCDIC.

If the DBRMMRIC (48th character of the STMT column) is equal to "L" and the DBRMPDRM (47th character of the STMT column) is also equal to "L", the STMT column will contain UNICODE characters. Otherwise, the STMT column will be in EBCDIC.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Database All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group