I have a problem I can't figure out a solution to - hopefully you can help!
I'm opening a large number of csv/xls/xlsx files in a loop as workfiles using the wfopen command. However, in some of the raw files, a variable exists, and in some, it does not. In my case, this variable is a registration identifier. One further problem is that this is in different columns in the raw files, although it always has the same name (regno). The problem is that EViews is automatically deciding that this variable is a number and importing it in as a series. However, in some of the workfiles, the underlying variables are alphanumeric (the identifiers contain letters as well as numbers - one example is IP29936R, and a numerical one is 1035401), but EViews is neglecting this and importing them as numerical series and throwing away the letters. Retaining the letters is critical for a future matching step.
My question therefore is: is there a way to open a named variable as a specific type? In my case, I always want to open this identifier, which is always called 'regno' as an alpha (character). For example, I have looked at something like:
Code: Select all
wfopen <{%CD}/filename.csv> ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma types=(,,A,) colhead=1 eoltype=pad badfield=NA @freq U 1 @smpl @allCode: Select all
wfopen <{%CD}/filename.csv> ftype=ascii rectype=crlf skip=0 fieldtype=delimited delim=comma regno=(A) colhead=1 eoltype=pad badfield=NA @freq U 1 @smpl @allAs always, any suggestions would be greatly, hugely appreciated :-)
Best wishes as always - and Merry Christmas!
Charlie
