Page 1 of 1

string delimited by size problem

PostPosted: Wed Apr 16, 2008 2:48 pm
by maaike c
I wrote the following:

MOVE SPACES                     TO PC-BEH-BERICHT         
                                                   
        perform varying irsz from 1 by 1 until irsz > 10           
          string 'Meerdere polisnummers in PB: '                   
             tabel-rsz-polis (1) ' '                               
             tabel-rsz-polis (2) ' '                               
             tabel-rsz-polis (3) ' '                               
             tabel-rsz-polis (4) ' '                               
             tabel-rsz-polis (5) ' '                               
                                     
             tabel-rsz-polis (6) ' '         
             tabel-rsz-polis (7) ' '         
             tabel-rsz-polis (8) ' '         
             tabel-rsz-polis (9) ' '         
             tabel-rsz-polis (10)             
             delimited by size               
             inTO   PC-BEH-BERICHT           

As a result I get:


'Meerdere polisnummers in PB: ' .........1234567

First I thought the dots wer low-values, but when I ftp the file to our servr they change in unreadable characters which is very annoying.

Does anyone has an idea how I can get rid of the dots?

Re: string delimited by size problem

PostPosted: Wed Apr 16, 2008 10:15 pm
by arunprasad.k
What does the array tabel-rsz-polis has??

From where do you get this '1234567'??

Try HEX ON and see the values in hexadecimal. X'00' is low-values and if you see anything other than this then you might have to back trace.

Arun.

Re: string delimited by size problem

PostPosted: Wed Apr 16, 2008 10:23 pm
by CICS Guy
maaike c wrote:perform varying irsz from 1 by 1 until irsz > 10
What is the point of the perform and where does it terminate?
          string 'Meerdere polisnummers in PB: '                   
             tabel-rsz-polis (1) ' '                               
             tabel-rsz-polis (2) ' '                               
             tabel-rsz-polis (3) ' '                               
             tabel-rsz-polis (4) ' '                               
             tabel-rsz-polis (5) ' '                               
                                     
             tabel-rsz-polis (6) ' '         
             tabel-rsz-polis (7) ' '         
             tabel-rsz-polis (8) ' '         
             tabel-rsz-polis (9) ' '         
             tabel-rsz-polis (10)             
What are the size and values in tabel-rsz-polis (1 through 10)?
As a result I get:
'Meerdere polisnummers in PB: ' .........1234567
How about a hex display of just what those unreadable characters are?
What are the values in tabel-rsz-polis (1 through 10) after the tenth iteration of the perform?
Does anyone has an idea how I can get rid of the dots?
Probably yes, but you must provide more than an incomplete snippet of your code....

Re: string delimited by size problem

PostPosted: Thu Apr 17, 2008 5:51 pm
by maaike c
this is the structure:
  FD PC-BEH                                     
     LABEL RECORDS ARE STANDARD                 
     DATA RECORD IS PC-BEH-ARTIKEL.             
                                                 
 01  PC-BEH-ARTIKEL.                             
     05 PC-BEH-mapij                 PIC X(01). 
     05 PC-BEH-FILLER-1              PIC X(01). 
     05 PC-BEH-BEHEERDER             PIC X(04). 
     05 PC-BEH-FILLER-2              PIC X(01). 
     05 PC-BEH-NR-CONTRACT           PIC X(12). 
     05 PC-BEH-FILLER-3              PIC X(01). 
     05 PC-BEH-DATUM-transfer        PIC X(08). 
     05 PC-BEH-FILLER-4              PIC X(01). 
     05 PC-BEH-INFO                  pic x(21). 
     05 PC-BEH-INFO-r redefines PC-BEH-info.               
        10 PC-BEH-WG-RSZ-NR          PIC X(09).             
        10 PC-BEH-FILLER-5           PIC X(01).             
        10 PC-BEH-WN-RSZ-NR          PIC X(10).             
        10 PC-BEH-FILLER-6           PIC X(01).             
     05 PC-BEH-BERICHT               PIC X(250).   


as you can see, the structure is defined in File section (not in working section) . Somebody told me this is a common problem if you work with QSAM files.You should always initialise the structure each time you fill it with data. With VSAM it would not cause a problem.
Anyway, that is what they told me.
I will now start looking where I have to move SPACES.
Thanks

Re: string delimited by size problem

PostPosted: Thu Apr 17, 2008 7:35 pm
by CICS Guy
maaike c wrote:as you can see, the structure is defined in File section (not in working section) . Somebody told me this is a common problem if you work with QSAM files.You should always initialise the structure each time you fill it with data. With VSAM it would not cause a problem.
Anyway, that is what they told me.
I will now start looking where I have to move SPACES.
Thanks
Heck, if you could give any less information, it would be a miracle...
Maybe a moderator will take pity on us and drop this thread into the 'Stupid Questions' bucket.....

Re: string delimited by size problem

PostPosted: Thu Apr 17, 2008 10:32 pm
by dick scherrer
Hello,

Anyway, that is what they told me.
Maybe you need a new they.

Are you simply trying to write an output qsam file?

Is there some reason you decided to use STRING? Moving spaces to PC-BEH-ARTIKEL will initialize the entire area to spaces. . .

Is the output to be a delimited file (otherwise, why is there a fillere between the fields?

You will probably get more usable answers if you post what you want to do rather than code at this point.