File Access with Fixed Length Fields

 10 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
April
Basic Member
Posts: 15
Basic Member
    I am new to PFI and am looking for a way to create a Lawson file daily that needs to contain fixed length fields.  Is this possible? 
    Thanks, April
    Sam Simpson
    Veteran Member
    Posts: 239
    Veteran Member
      There is a javascript functions called addLeadingSpaces, addLeadingZeros, addTrailingSpaces and addTrailingZeros that you can use to have you fields have the same length and then use the formated variable into your FileAccess node.
      KK - Infor
      Veteran Member
      Posts: 61
      Veteran Member
        yes it is possible. As Sam said, you will have to use Branches/ javaScript statements and add/ trim spaces/ characters to make the fields fixed length.

        KK
        April
        Basic Member
        Posts: 15
        Basic Member
          Ok, I got some of the fields to work, still working on others.  Another question - How do I filter only the distinct records for job codes?  I am pulling from the Employee table (only because that is where the field I need is located) and so it is giving me an entry for each Associate.  But I only want the job codes listed once.  Any ideas?
          Thanks, April
          David Williams
          Veteran Member
          Posts: 1127
          Veteran Member
            If you want the Job Codes, why not pull from the correct table that lists them?
            David Williams
            April
            Basic Member
            Posts: 15
            Basic Member
              I tried but the field l need in addition is the ot-plan-code (contains exempt/non-exempt) and the only place they filled in the tables for the build is in the employee table.  By pulling the job code table, I couldn't find a link/relationship anywhere for the employee table.  Do you know of a way of getting around this?
              Thanks, April
              John Henley
              Posts: 3353
                So you want to pull only certain job codes from the EMPLOYEE table? You can add a &SELECT=JOB-CODE=XXX to the DME/query string.
                Thanks for using the LawsonGuru.com forums!
                John
                Sam Simpson
                Veteran Member
                Posts: 239
                Veteran Member
                  Please explain more about distinct job codes. What if the employee has two job codes (it means EE can work on two different jobs on the same company)? The employee table is not reliable for job codes but you can use PAEMPOS table for what you are looking for.

                  Better yet, please explain what your processflow is all about. It's more easier to see the scenario if we know the purpose. Maybe all you need is to use the related tables attached to the Employee table in your query node.
                  Sam Simpson
                  Veteran Member
                  Posts: 239
                  Veteran Member
                    It seems to me you wanted to list job codes and all employees within that jobcodes including if the employee is either exempt or non-exempt. Is that correct?
                    April
                    Basic Member
                    Posts: 15
                    Basic Member
                      Sorry for any confusion.  Here is what I am trying to do - create a fixed length file for the Job Class which includes the following fields and values:
                      • OrganizationUnit (hard code "A") - size 16
                      • Filler (blank space) - 80
                      • Job Code - 16
                      • Job Code again - 9
                      • EmployeeCategory (ot-plan-code) - 16 (values in table are BWNE and BWEX - in file needs to be converted over to NE and E)
                      • Job code description - 256
                      So this is what I have so far:
                        in my query I have - PROD=&FILE=EMPLOYEE&FIELD=JOB-CODE;OT-PLAN-CODE;JOB-CODE.DESCRIPTION&OUT=CSV&DELIM=~
                        then I have a branch for exempt/non-exempt and have the assigns going to msgbuilders.  In my msgbuilders, I have 
                      (note: some of the variables are fillers for the spaces that I added in to make up the remaining characters to fill the fixed length field, and the other msgbuilder refers to the exempt filler)
                        then I have the end of the query, followed by the file access which has    then the pfi ends.  
                      Thanks for any/all help!  April

                       
                      Sam Simpson
                      Veteran Member
                      Posts: 239
                      Veteran Member
                        As I have stated before, The job code in the employee table is the default job code for an employee. If an employee works for different job codes (like nurses etc) then you will use PAEMPPOS table. I still cannot see what the purpose of your output file. there is no relation to the employee except the ot_plan_code. Mostly there are only two categories for the plan either exempt or non-exempt. Please tell us if you are counting ot_plan_code by jobcodes or what.

                        Usually something like this is better off writing in a 4GL code or in Crystal and schedule it thru the job scheduler. ProcessFlow realy is more on the work side and the steps to accomplish the end results.

                        A clearer picture always result in a clearer view.