× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Sunil,

first a couple of questions, and maybe your answer:

1. why are you specifying a 'tofile'.  do you want the array to be written
to PF5?  I'm not sure, but i think that's what tofile() means.

2. how many records did you add to PF1?  if more than one, your program
will bomb - too many elements - array not big enough - DIM(1)

2. I think that using a packed field as your input table file is what's
causing your problem.   The program has no way of determining that the
input file is packed data, since it is internally described to the program.
So, it just assumes character and lays in on top of the array field.

Can you change PF1 to be 9S 0 instead of 9P 0?  I've tested this and it
works fine.

here is my program:

FTESTING   IT   F    9        DISK
DARE              S              9S 0 DIM(12)
D                                     FROMFILE(TESTING)
C     ARE(1)        DSPLY
C     ARE(2)        DSPLY
C     ARE(3)        DSPLY
C     ARE(4)        DSPLY
C     ARE(5)        DSPLY
C     ARE(6)        DSPLY
C     ARE(7)        DSPLY
C     ARE(8)        DSPLY
C     ARE(9)        DSPLY
C     ARE(10)       DSPLY
C     ARE(11)       DSPLY
C     ARE(12)       DSPLY
C                   EVAL      *INLR = *ON

and my PF (TESTING)

A          R TESTR
A            DATA           9S 0
A          K DATA


hope this helps.

Rick

-----original message--------
I have some doubts
1) Am I right in saying that program creates a temporary program described
table where the values from the pf is loaded and used during the execution
of the program.
2) Does the Table file have ant relation to the create Table in SQL/400.
I was not able to declare the file directly in the Table in the d spec.
3) I am getting an error when I run the program with packed decimal fields
I
am getting junk during the transformation i.e from the File to the Table
resulting in a decimal data error.
  I am not getting any error if I change the fields as char.
Also no error if I don't put any values in the pf.
I am including the code that I had tried out. So that you can get the
correct picture.

The program

FPF1       IT   F   10        DISK
FPF5       CT   F   10        DISK
DARE              S              9P 0 DIM(1)
D                                     FROMFILE(PF1)
D                                     TOFILE(PF5)
C     ARE(1)        DSPLY
C                   EVAL      *INLR = *ON

The PF
                R PF
                  FLD1           9P 0
                K FLD1

Thankyou very much for your help

Sunil



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.