Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python Code - TypeError: loop over non-sequence

Status
Not open for further replies.

cooldibs

Technical User
Apr 9, 2014
7
0
0
US
hello, we are getting this issue with a Python Program. Anyone has any clue?


Traceback (most recent call last):
File "cbl_data.py", line 149, in ?
field_list = create_field_list('cbl_data.cfg')
File "cbl_data.py", line 35, in create_field_list
for line in open(config_file):
TypeError: loop over non-sequence




The config file details as follows.

x:2 # character field - probably key
p:17 # unpacked numeric
z:2
x:19
x:4
x:10
z:4
x:1
z:3
x:1
p:12
p:12
x:10
x:4

Code

def create_field_list(config_file):
"""returns list of fields definition from the config file"""
config_list = []
nr_lines = 0
for line in open(config_file):
nr_lines += 1
cfg_line = line
# remove comments from line
if '#' in cfg_line:
cfg_line=cfg_line[:cfg_line.index('#')]
# strip blanks from both ends
cfg_line = cfg_line.strip()
# process not empty lines
if len(cfg_line) > 0:
if ':' in cfg_line:
# to uppercase
cfg_line=cfg_line.upper()
# split into a list
cfg_line_list=cfg_line.split(':')
if cfg_line_list[1].isdigit():
cfg_line_list[1] = string.atoi(cfg_line_list[1])
# compute the length of Packed Decimal (COMP-3)
if cfg_line_list[0]=='P':
cfg_line_list[1]=cfg_line_list[1]/2 + 1
#print cfg_line_list
config_list.append(cfg_line_list)
else:
print "Error in config line %d:" % nr_lines
print "'%s'" % cfg_line
print "Data type length is not numeric !"
sys.exit()
else:
print "Error in config line %d:" % nr_lines
print "'%s'" % cfg_line
print "Line should have a form <DataType>:<length> !"
sys.exit()
# return list of fields
return config_list
 
Hi

The only thing I can think to is that [tt]open()[/tt] was re-declared somewhere before that code. To check it, insert this before the line throwing the error :
Python:
print open.__module__
For the "official" [tt]open()[/tt] function should output '__builtin__'.

Next time please post your code between [tt][ignore]
Code:
[/ignore][/tt] and [tt][ignore]
[/ignore][/tt] TGML tags.


Feherke.
feherke.ga
 
hello here is the full code, didn't get much help with above steps. It would be great if you can run the same code and debug it for me? Basically my requirement is to convert a EBCDIC file to an ASCII output and getting this issue. Let me know if you need any other info?

Code:
import sys, string, array
# The functions zoned2num() and packed2num() are taken from Carey Evans
# ([URL unfurl="true"]http://mail.python.org/pipermail/python-list/2000-April/031051.html)[/URL]
def zoned2num(z):
  a = array.array('B', z)
  v = 0L

  for i in a:
    v = (v * 10) + (i & 0xf)

  if (a[-1] & 0xf0) == 0xd0:
    v = -v

  return v

def packed2num(p):
  a = array.array('B', p)
  v = 0L

  for i in a[:-1]:
    v = (v * 100) + (((i & 0xf0) >> 4) * 10) + (i & 0xf)

  i = a[-1]
  v = (v * 10) + ((i & 0xf0) >> 4)
  if (i & 0xf) == 0xd:
    v = -v

  return v


def create_field_list(config_file):
  """returns list of fields definition from the config file"""
  config_list = []
  nr_lines = 0
  for line in open(config_file):
    nr_lines += 1
    cfg_line = line
    # remove comments from line
    if '#' in cfg_line:
      cfg_line=cfg_line[:cfg_line.index('#')]
    # strip blanks from both ends
    cfg_line = cfg_line.strip()
    # process not empty lines
    if len(cfg_line) > 0:
      if ':' in cfg_line:
        # to uppercase
        cfg_line=cfg_line.upper()
        # split into a list
        cfg_line_list=cfg_line.split(':')
        if cfg_line_list[1].isdigit():
          cfg_line_list[1] = string.atoi(cfg_line_list[1])
          # compute the length of Packed Decimal (COMP-3)
          if cfg_line_list[0]=='P':
            cfg_line_list[1]=cfg_line_list[1]/2 + 1
          #print cfg_line_list
          config_list.append(cfg_line_list)
        else:
          print "Error in config line %d:" % nr_lines
          print "'%s'" % cfg_line
          print "Data type length is not numeric !"
          sys.exit()
      else:
        print "Error in config line %d:" % nr_lines
        print "'%s'" % cfg_line
        print "Line should have a form <DataType>:<length> !"
        sys.exit()
  # return list of fields
  return config_list

def parse_cbl_data(cbl_data_file,
                   record_size, nr_records, field_list,
                   format_packed=1, dbg_mode=1):
  """Parsing data from cbl_data_file according to the fields
     definition in field_list
     dbg_mode = 0 without debug info
              = 1 print debug info
     format_packed = 0 print digits in packed fields as necoded
                   = 1 print packed fields as numbers with 2 decimals"""
  # open input file in binyry mode for reading
  f=open(cbl_data_file,"rb")
  # open output file for writing
  csv_out_file=open(cbl_data_file+".csv","w")
  # process records
  nr_rec=0
  while (nr_rec < nr_records):
    nr_rec += 1
    rec = f.read(record_size)
    print "* Processing %0004d record " % nr_rec
    if dbg_mode:
      print repr(rec)
    start_byte=0
    end_byte = 0
    total_bytes =0
    # parse fields
    nr_fld=0
    data_line_list=[]
    for field in field_list:
      nr_fld += 1
      #print field
      total_bytes += field[1]
      end_byte = total_bytes
      #print "%d - %d" % (start_byte,end_byte)
      field_data=rec[start_byte:end_byte]
      if dbg_mode:
        print repr(field_data)
        #ar=array.array('B', field_data)
        #print ar
      if field[0]=='X':
        fld_data=repr(field_data)
        fld_data=field_data
      elif field[0]=='Z':
        fld_data_num=zoned2num(field_data)
        # convert to string
        fld_data=str(fld_data_num).strip()
      elif field[0]=='P':
        fld_data_num=packed2num(field_data)
        # convert to string
        fld_data=str(fld_data_num).strip()
        if format_packed:
          if fld_data_num == 0:
            fld_data = '0.00'
          else:
            fld_data = fld_data[:-2]+'.'+fld_data[-2:]
      print fld_data
      data_line_list.append(fld_data)
      start_byte=end_byte
    # write data_line in a result file:
    data_line=string.join(data_line_list,';')+"\n"
    if dbg_mode:
      print data_line_list
      print data_line
    csv_out_file.write(data_line)
  #
  print "number of records processed = %d" % nr_records
  print "number of fields in record  = %d" % len(field_list)
  print "bytes in fields = %d / bytes in record = %d"        % (total_bytes,record_size)
  if total_bytes > record_size:
    print "The record is not correct divided into fields !"
  # close all files
  f.close()
  csv_out_file.close()

# Main program
if __name__ == "__main__":
  #print packed2num('\x12\x34\x5f')
  #print zoned2num('\xf1\xf2\xd3')
  #print zoned2num('\x01\x02\x03')
  field_list = create_field_list('cbl_data.cfg')
  # record_size=774
  # nr_records=277
  parse_cbl_data('athacct_dly_init.dat',4051,50,field_list,dbg_mode=1)
 
Hi

Your code works fine for me with Python 2.7.6. Of course, the parse_cbl_data() call fails as I have no real athacct_dly_init.dat file. But the create_field_list() you have problem with, works with the sample data you posted earlier.

Sorry, I have no further idea.


Feherke.
feherke.ga
 
Hi,
Some years ago I posted this code here
to solve the problem with a COBOL file described here
It was only written to solve this particular problem and it isn't universal anyway.

Have you tried the code first with the original file posted in the COBOL forum above?
What Python version are you using? I wrote it with Python 2.5.x . As Feherke mentioned it should probably work with 2.7.x but not with 3.x (I never moved to Python 3).

I thing the COBOL original file in the forum above was cretated by RM/COBOL compiler for DOS. So it wasn't probably in EBCDIC but in ASCII.
Maybe this Record Editor could help you
It's mentioned here
 
I am using version-2.6.6. Is it a limitation for version-2.6.6 and do I need to upgrade it to 2.7.6?

$>python
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.

>>> import sys
>>> sys.version_info
(2, 6, 6, 'final', 0)
>>>
 
IMO it should work with 2.6. First try to run the program with the original RM/COBOL file posted in the COBOL-thread mentioned above. If it works, then you could try to adjust the config file to work with your file. But as I mentioned above it was one purpose program.

If you get an errors, python says you on which line the error occured. So you can print the variables on this line to discover what is wrong.
 
Perhaps a stupid question: are you certain the file, cbl_data.cfg, is in the the current working directory? Have you tried fully qualifying the file name in field_list = create_field_list('cbl_data.cfg')?

_________________
Bob Rashkin
 
hello - now after I upgraded the version to 2.7, it started working. But now its getting a different error. It has partially converted the first record and failing at 2nd record. I will try to debug it now but thought of sharing it with you all to see if any of you have faced such issues in past and can give me a pointer?

The Python script getting failed with the below error message.
==============================================================================
ñ@;4652908.96;1;ððððððððððððððððððñ;×äÙÇ;òððô`ðô`òð;0;ð;176;ð;125010108.20;135.35;ñð`ðõ`ðòÃÙ;âòñ@
* Processing 0002 record
''
''
''
Traceback (most recent call last):
File "cbl-data2.py", line 152, in <module>
parse_cbl_data('athacct_dly_init.dat',4051,50,field_list,dbg_mode=1)
File "cbl-data2.py", line 116, in parse_cbl_data
fld_data_num=packed2num(field_data)
File "cbl-data2.py", line 23, in packed2num
i = a[-1]
IndexError: array index out of range
==============================================================================



where cbl-data2.py is the python code I have shared before.
 
I would try to find out what data is entering into the procedure, i.e. place some print-statements into the code on these places
Code:
...
def packed2num(p):
  a = array.array('B', p)
  [highlight]print a[/highlight]
  v = 0L
...
...
      elif field[0]=='P':
        [highlight]print field_data[/highlight]
        fld_data_num=packed2num(field_data)
...
 
If this helps, this is the complete out of the program run.

***>python cbl-data2.py athacct_dly_init.dat cbl_data.cfg
* Processing 0001 record
'\xf1@\x00\x00\x00\x00FR\x90\x89l\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xd7\xe4\xd9\xc7\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0\x00\x00\x00\x00\xf0\xf1\xf7\xf6\xf0\x00\x12P\x10\x10|\x00\x00\x00\x00\x00\x0c\xf2\xf0\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9\xe2\xf2\xf1@\x00\x00\x00\x00I0\x84U\x9c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf9\xc3\xd9\xe2\xf2\xf2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1\x00\x14\x81tXl\x01\x01\x07g)\x0c@@@@@@@@@@\xc3\xd9\xe2\xf2\xf1@\x00\x00\x00\x00I0\x84V\x0c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf2\xf7\xc3\xd9\xe2\xf2\xf2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1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@\x00\x00\x00\x00I0\x84`\x8c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf5\xf5\xf8\xc3\xd9\xe2\xf2\xf2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1\x00\x14\x81tcL\x01\x14\x07DG\x1c@@@@@@@@@@\xc3\xd9\xe2\xf2\n'
'\xf1@'
ñ@
'\x00\x00\x00\x00FR\x90\x89l'
4652908.96
'\x00\x01'
1
'\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1'
ððððððððððððððððððñ
'\xd7\xe4\xd9\xc7'
×äÙÇ
'\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0'
òððô`ðô`òð
'\x00\x00\x00\x00'
0
'\xf0'
ð
'\xf1\xf7\xf6'
176
'\xf0'
ð
'\x00\x12P\x10\x10|\x00'
125010108.20
'\x00\x00\x00\x00\x0c\xf2\xf0'
135.35
'\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9'
ñð`ðõ`ðòÃÙ
'\xe2\xf2\xf1@'
âòñ@
['\xf1@', '4652908.96', '1', '\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1', '\xd7\xe4\xd9\xc7', '\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0', '0', '\xf0', '176', '\xf0', '125010108.20', '135.35', '\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9', '\xe2\xf2\xf1@']
ñ@;4652908.96;1;ððððððððððððððððððñ;×äÙÇ;òððô`ðô`òð;0;ð;176;ð;125010108.20;135.35;ñð`ðõ`ðòÃÙ;âòñ@

* Processing 0002 record
''
''

''
Traceback (most recent call last):
File "cbl-data2.py", line 152, in <module>
parse_cbl_data('athacct_dly_init.dat',4051,50,field_list,dbg_mode=1)
File "cbl-data2.py", line 116, in parse_cbl_data
fld_data_num=packed2num(field_data)
File "cbl-data2.py", line 23, in packed2num
i = a[-1]
IndexError: array index out of range
 
Thanks, I did those changes and printed them and here is the output. Does this help?

***>python cbl-data2.py athacct_dly_init.dat cbl_data.cfg
* Processing 0001 record
'\xf1@\x00\x00\x00\x00FR\x90\x89l\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xd7\xe4\xd9\xc7\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0\x00\x00\x00\x00\xf0\xf1\xf7\xf6\xf0\x00\x12P\x10\x10|\x00\x00\x00\x00\x00\x0c\xf2\xf0\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9\xe2\xf2\xf1@\x00\x00\x00\x00I0\x84U\x9c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1\xf9\xc3\xd9\xe2\xf2\xf2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1\x00\x14\x81tXl\x01\x01\x07g)\x0c@@@@@@@@@@\xc3\xd9\xe2\xf2\xf1@\x00\x00\x00\x00I0\x84V\x0c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf2\xf7\xc3\xd9\xe2\xf2\xf2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1\x00\x14\x81tX|\x01\x01\x07g)\x1c@@@@@@@@@@\xc3\xd9\xe2\xf2\xf1@\x00\x00\x00\x00I0\x84V\x1c\x00\x01\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\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f2\xf0\xf0\xf6`\xf0\xf8`\xf1\xf6\x00\x00\x03\xfd\xf1\xf3\xf0\xf0\xf1\x00\x14\x81tcL\x01\x14\x07DG\x1c@@@@@@@@@@\xc3\xd9\xe2\xf2\n'
'\xf1@'
ñ@
'\x00\x00\x00\x00FR\x90\x89l'
FRl
array('B', [0, 0, 0, 0, 70, 82, 144, 137, 108])
4652908.96
'\x00\x01'
1
'\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1'
ððððððððððððððððððñ
'\xd7\xe4\xd9\xc7'
×äÙÇ
'\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0'
òððô`ðô`òð
'\x00\x00\x00\x00'
0
'\xf0'
ð
'\xf1\xf7\xf6'
176
'\xf0'
ð
'\x00\x12P\x10\x10|\x00'
P|
array('B', [0, 18, 80, 16, 16, 124, 0])
125010108.20
'\x00\x00\x00\x00\x0c\xf2\xf0'
òð
array('B', [0, 0, 0, 0, 12, 242, 240])
135.35
'\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9'
ñð`ðõ`ðòÃÙ
'\xe2\xf2\xf1@'
âòñ@
['\xf1@', '4652908.96', '1', '\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf1', '\xd7\xe4\xd9\xc7', '\xf2\xf0\xf0\xf4`\xf0\xf4`\xf2\xf0', '0', '\xf0', '176', '\xf0', '125010108.20', '135.35', '\xf1\xf0`\xf0\xf5`\xf0\xf2\xc3\xd9', '\xe2\xf2\xf1@']
ñ@;4652908.96;1;ððððððððððððððððððñ;×äÙÇ;òððô`ðô`òð;0;ð;176;ð;125010108.20;135.35;ñð`ðõ`ðòÃÙ;âòñ@

* Processing 0002 record
''
''

''

array('B')
Traceback (most recent call last):
File "cbl-data2.py", line 154, in <module>
parse_cbl_data('athacct_dly_init.dat',4051,50,field_list,dbg_mode=1)
File "cbl-data2.py", line 118, in parse_cbl_data
fld_data_num=packed2num(field_data)
File "cbl-data2.py", line 24, in packed2num
i = a[-1]
IndexError: array index out of range
 
It seems that you are trying to process 50 records of size 4051
Code:
if __name__ == "__main__":
  #print packed2num('\x12\x34\x5f')
  #print zoned2num('\xf1\xf2\xd3')
  #print zoned2num('\x01\x02\x03')
  field_list = create_field_list('cbl_data.cfg')
  # record_size=774
  # nr_records=277
  [highlight]parse_cbl_data('athacct_dly_init.dat',4051,50,field_list,dbg_mode=1)[/highlight]
and it seems to be wrong.
Before using this program you have to know the record size and number of records properly.

I found out the record size an number of records probably looking into the file with an hex editor - see my comment in this thread

mikrom (Programmer) 23 Oct 08 7:03
I examined the file Bp081005.dat

The file seems to have a record of the length 774 bytes and seems to contain 277 records.
If you multiply record length with number of records, i.e 774*277 = 214398, what exactly is the file length of Bp081005.dat.
 
I tried changing the size but its not working.

Here is how the Layout looks like for EBCDIC file. And the corresponding config file. Do you think anything wrong inmapping?

ebcdic string(2) A;
packed decimal(17,0) B;
signed big endian integer(2) C;
ebcdic string(19) D;
ebcdic string(4) E;
ebcdic string(10) F;
signed big endian integer(4) G;
ebcdic string(1) H;
ebcdic decimal(3,0) I;
ebcdic string(1) J;
packed decimal(12,0) K;
packed decimal(12,0) L;
ebcdic string(10) M;
ebcdic string(4) N;


x:2 # character field - probably key
p:17 # unpacked numeric
z:2
x:19
x:4
x:10
z:4
x:1
z:3
x:1
p:12
p:12
x:10
x:4


Actual Data Output Should Be:

Record 1:
[record
A "1 "
B " 465290896"
C 1
D "0000000000000000001"
E "PURG"
F "2004-04-20"
G 0
H "0"
I "176"
J "0"
K " 125010107"
L " 0"
M "2010-05-02"
N "XXX2"]]


But after execution it comes as. First few things matches.


ñ@;4652908.96;1;ððððððððððððððððððñ;×äÙÇ;òððô`ðô`òð;0;ð;176;ð;125010108.20;135.35;ñð`ðõ`ðòÃÙ;âòñ@
;1201;ð;151515151515.15;151515151515.15;ððóõÃÙâòòð;ðö`ð
;10767293240404.04;0;@@@@ÃÙâòò@
òò;400000000049308.45;120;ðððððððððððððððððõ;ñÃÙâ;òòððö`ðø`ñ;6003;ý;130;ð;151001481745.90;1020754674.24;@@@@@@@@@Ã;Ùâòò
ðð;1515151515151515.15;78;ÃÙâòòððö`ðø`ñötYT;8200;@;0;@;40404124404.35;153400000000.04;0
V\ððö`


 
As I said before: the RM/COBOL file (for which the program was made) was in ASCII not EBCDIC.
Maybe examine the file in hexeditor and try to write your own translation for the strings.

 
Btw, you hav an error in config too:
ebcdic decimal(3,0) I;
should be
p:3 /packed/
and not
z:3 /zoned/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top