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

DSN REXX VARBINARY inserts


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 69

PostPosted: Tue Oct 19, 2021 4:19 am
Reply with quote

Has anyone been able to insert values into a VARBIN DB2 column using rexx ?
I tried different options including enclosing the rexx host variable within bx'...'
When try to insert '1234567890123456FDABCAEA'X it chops off the first 2 bytes and adds binary zeroes at the end.
I have no clue what is going on
Is it even possible to do varbinary inserts using rexx or should I try to do this in Cobol ?
Code:
 /* rexx */                                             
parse arg subsys creator                               
numeric digits 4096                                     
pgpKey1 = '1234567890123456FDABCAEA'X                   
                                                       
nonArmoredPGPKey   = bx"'"pgpKey1"'"                   
keyType = 'N'                                           
insertPGPKey = "insert into "creator".transmission_key",
" (key_non_armored, key_type)",                         
" values(?,?)"       


Code:
                                                                   
îÌ°::îÙ¿­² 
579135FACE00
680246DBAA00
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 69

PostPosted: Tue Oct 19, 2021 4:26 am
Reply with quote

After 70 bytes it just inserts binary zeroes
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
******************************** Top of Data ***********************************
îÌ°::îÙ¿­²:ÍÈïäïèïáÈ:ï¿ò::îÌ°::îÙ¿­²:ÍÈïäïèïáÈ:ï¿ò::îÌ°::îÙ¿­²:ÍÈïäïèï         
579135FACE277545554715AC13579135FACE277545554715AC13579135FACE277545550000000000
680246DBAA354737475437BD24680246DBAA354737475437BD24680246DBAA354737470000000000
 ------------------------------------------------------------------------------
                                                                               
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
                                                                               
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
                                                                               
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
                                                                               
00000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
 ------------------------------------------------------------------------------
[/quote]
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 512
Location: Denmark

PostPosted: Tue Oct 19, 2021 1:57 pm
Reply with quote

What is the required format for the key value? What does the 'bx' prefix signify? Are you sure that the value is binary and not hex?
Back to top
View user's profile Send private message
harisukumaran

New User


Joined: 14 Jun 2005
Posts: 69

PostPosted: Tue Oct 19, 2021 8:21 pm
Reply with quote

I was some how able to get it to work with the code below
Code:
nonArmoredPGPKey   = bx"'"c2x(pgpKey1)"'"                   
insertPGPKey = "insert into "creator".transmission_key",   
" (key_id, key_non_armored, key_type)",                     
" values(?,(select varbinary("nonArmoredPGPKey",",         
                           "4096) from sysibm.sysdummy1),?)"


But I am not able to figure out how to get this to work when the varbin variable is parameterized
Back to top
View user's profile Send private message
Willy Jensen

Active Member


Joined: 01 Sep 2015
Posts: 512
Location: Denmark

PostPosted: Tue Oct 19, 2021 9:37 pm
Reply with quote

re bx"'"c2x(pgpKey1)'"' you could have done it simpler as

nonArmoredPGPKey = "BX'1234567890123456FDABCAEA'"

hence my question about required format.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts REXX Test under Mask??? CLIST & REXX 3
No new posts Can you give me examples of programs ... CLIST & REXX 9
No new posts ZOS Console commands through USS REXX? CLIST & REXX 5
No new posts REXX table content on panel will be r... CLIST & REXX 6
No new posts Tilde Characters Changing to COLONs i... CLIST & REXX 22
Search our Forums:

Back to Top