![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version |
#3
| |||
| |||
|
|
ROB wrote: I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version No problem with that line of code, even with spaces in the ID. What's the problem you are having? -- frosty |
#4
| |||
| |||
|
|
Make sure you don't have a null item with a null ID. Try editing item "" in that file. If you get one, then delete it and try to find which program is writing null records with null IDs. Glen "ROB" <RSTRUCK (AT) UNACLAD (DOT) COM> wrote in message news:1149284416.236081.268550 (AT) c74g2000cwc (DOT) googlegroups.com... It is coming back with a blank record. After the read I check if it is blank and if it is go to the next record. An example of the key is AK_FAIRBANKS NORTH STAR frosty wrote: ROB wrote: I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version No problem with that line of code, even with spaces in the ID. What's the problem you are having? -- frosty |
#5
| |||
| |||
|
|
There are no null items. We imported a state county table into our system. So it will be a pretty static table. The id is made up of the state abreviation and the county name. So all the items have some info. Glen B wrote: Make sure you don't have a null item with a null ID. Try editing item "" in that file. If you get one, then delete it and try to find which program is writing null records with null IDs. Glen ROB wrote: It is coming back with a blank record. After the read I check if it is blank and if it is go to the next record. An example of the key is AK_FAIRBANKS NORTH STAR ROB wrote: I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version |
#6
| |||
| |||
|
|
Is it a "DIR" type (native) file or an "F" type (uniData) file? Are you running uniData atop *nix or Windoze? You had writ: READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" ...and... "After the read I check if it is blank and if it is go to the next record." So I'm guessing that right after the "READ ST_CNTY_REC..." line, you have "IF ST_CNTY_REC = '' THEN..." or the like? You should do something different on the "ELSE" branch, as the way you have coded it, you cannot determine if the read was successful, but returned a null record, _or_ if the read was unsuccessful. You think it's the former, but it sounds like it's the latter. -- frosty ROB wrote: There are no null items. We imported a state county table into our system. So it will be a pretty static table. The id is made up of the state abreviation and the county name. So all the items have some info. Glen B wrote: Make sure you don't have a null item with a null ID. Try editing item "" in that file. If you get one, then delete it and try to find which program is writing null records with null IDs. Glen ROB wrote: It is coming back with a blank record. After the read I check if it is blank and if it is go to the next record. An example of the key is AK_FAIRBANKS NORTH STAR ROB wrote: I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version |
#7
| |||
| |||
|
|
We have Unidata on top of Windows After my read I have IF ST_CNTY_REC <> "" THEN OUTREP = ST_CNTY_REC<2 ELSE DISPLAY A MESSAGE WITH THE KEY END I am not at work but I think that it is a F. |
#8
| |||
| |||
|
|
I am having a brain freeze. I want to read a file and the key or id can have spaces in it. Can someone help. Here is part of my code. READ ST_CNTY_REC FROM F.ST_CNTY, KEY ELSE ST_CNTY_REC = "" Oh, this is Unidata version |
![]() |
| Thread Tools | |
| Display Modes | |
| |