There's a hashed file which has two columns - Col1 and Col2. Col1 contains vachar data and is a key. Col2 is a timestamp field. I need to update Col2 data to '1700-01-01 00:00:00'.
Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth &
Name.......... Number Definition... Code........ Heading........ Format Assoc..
@ID D 0 SDKMaxLastUpdDt 10L S
tm_E
1 records listed.
My try with the following code was unsuccessful:
UPDATE <hashed file> SET Col2 = '1700-01-01 00:00:00'
Got error like - Invalid token at Col2.
How do I address columns in a Hashed file which has no names?
If you want to use SQL to insert or update, you will need to provide column names in the file dictionary. Search DSXchange for "INSERT INTO DICT" for examples.
Otherwise you can use DataStage BASIC code (which does not need column names) or an operating system command such as UVwrite.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Hashed files columns are referenced positionally, not by name. Ever wondered why the 'column names' you use in the stage don't really matter? That's why and I assume part of the answer.
-craig
"You can never have too many knives" -- Logan Nine Fingers
say the hashfile was created with a path and no VOC entry and i need to update the hashfile (xyz.hs) for the key column value=100 to set a column no 3 to 'A'
to achieve this using SQL i guess we need to make a VOC entry first, define the metadata and then fire the update right?
Ordinarily the entry for the field definition would be in the file dictionary rather than the VOC file. If you want to use SQL to change the record, then you will also need a VOC entry for the hashed file itself.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.