Converting Crystal Rpt criteria (sql) over to Lawson 4GL...HELP

Sort:
You are not authorized to post a reply.
Author
Messages
Sarah
Advanced Member
Posts: 33
Advanced Member
    Good afternoon. We have a weekly file that goes to our medical insurance carrier and tells the carrier:
    1. Employees that have current medical, dental and\or fsa\hsa plans with a row for the employee and a row for every dependent that is attached to the plan(s).
    2. Employees that have changed medical, dental and\or fsa\hsa plans with a row for the employee and a row for every dependent that is attached or ended their plan(s).

    If I populate the crystal report sql and record selection, grouping for the ee rpt (I pull the data for ee's in 1 rpt, the dependents in another.) can someone help me convert it to lawson 4gl cobol?

    EE report

    SQL
    SELECT "EMPLOYEE"."EMPLOYEE", "BENEFIT"."PLAN_CODE", "BENEFIT"."PLAN_TYPE", "BENEFIT"."UPD_DATE", "BENEFIT"."STOP_DATE", "EMPLOYEE"."LAST_NAME", "EMPLOYEE"."FIRST_NAME", "BENEFIT"."START_DATE", "BENEFIT"."COV_OPTION", "EMPLOYEE"."FICA_NBR", "EMPLOYEE"."EMP_STATUS"
    FROM "LAWPROD"."EMPLOYEE" "EMPLOYEE" INNER JOIN "LAWPROD"."BENEFIT" "BENEFIT" ON ("EMPLOYEE"."EMPLOYEE"="BENEFIT"."EMPLOYEE") AND ("EMPLOYEE"."COMPANY"="BENEFIT"."COMPANY")
    WHERE (("BENEFIT"."PLAN_TYPE"='DN' OR "BENEFIT"."PLAN_TYPE"='HL') AND ("BENEFIT"."UPD_DATE">=TO_DATE ('25-03-2013 00:00:00', 'DD-MM-YYYY HH24:MI:SS') AND NOT ("BENEFIT"."STOP_DATE">=TO_DATE ('01-01-1700 00:00:00', 'DD-MM-YYYY HH24:MI:SS') AND "BENEFIT"."STOP_DATE"<TO_DATE ('02-01-1700 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) OR ("BENEFIT"."STOP_DATE">=TO_DATE ('01-01-1700 00:00:00', 'DD-MM-YYYY HH24:MI:SS') AND "BENEFIT"."STOP_DATE"<TO_DATE ('02-01-1700 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) OR "BENEFIT"."STOP_DATE">=TO_DATE ('25-03-2013 00:00:00', 'DD-MM-YYYY HH24:MI:SS')) OR "BENEFIT"."PLAN_TYPE"='RS' AND ("BENEFIT"."UPD_DATE">=TO_DATE ('25-03-2013 00:00:00', 'DD-MM-YYYY HH24:MI:SS') OR "BENEFIT"."STOP_DATE"<TO_DATE ('01-01-2014 00:00:00', 'DD-MM-YYYY HH24:MI:SS'))) AND NOT ("BENEFIT"."PLAN_CODE" LIKE 'HSA3%' OR "BENEFIT"."PLAN_CODE" LIKE 'V%' OR "BENEFIT"."PLAN_CODE" LIKE 'W%') AND NOT ("BENEFIT"."PLAN_CODE"='DN03' OR "BENEFIT"."PLAN_CODE"='FD01' OR "BENEFIT"."PLAN_CODE"='FDX1' OR "BENEFIT"."PLAN_CODE"='FDX1' OR "BENEFIT"."PLAN_CODE"='FH01') AND "BENEFIT"."START_DATE">=TO_DATE ('01-01-2013 00:00:00', 'DD-MM-YYYY HH24:MI:SS')

    Record Selection

    ({BENEFIT.PLAN_TYPE} in ["DN", "HL"] and
    ({BENEFIT.UPD_DATE}>={?Date Keyed}-7 and {BENEFIT.STOP_DATE}<>datevalue(1700,01,01) or {BENEFIT.STOP_DATE}=datevalue(1700,01,01) or {BENEFIT.STOP_DATE}>={?Date Keyed}-7 ) OR
    {BENEFIT.PLAN_TYPE}="RS" AND ({BENEFIT.UPD_DATE}>={?Date Keyed}-7 OR {BENEFIT.STOP_DATE}<=datevalue(year(currentdate),12,31))) and
    not ({BENEFIT.PLAN_CODE} startswith ["W","V","HSA3"]) and
    not({BENEFIT.PLAN_CODE}in["DN03","FH01","FD01","FDX1","FDX1"]) and
    {BENEFIT.START_DATE}>=DATEVALUE(year(currentdate),01,01)

    {BENEFIT.START_DATE}=MAXIMUM({BENEFIT.START_DATE},{@EEPLNTYP})

    Formula
    {@EEPLNTYP}={EMPLOYEE.EMPLOYEE}&{BENEFIT.PLAN_TYPE}

    Thank you for any suggestions or help no this.

    Sarah
    Ragu Raghavan
    Veteran Member
    Posts: 468
    Veteran Member
      Sarah,

      You will need to create a program in pgmdef, define the file layout in workdef and code the necessary logic to lookup the BENEFIT/EMPLOYEE tables and populate the file.
      I would estimate 16-24 hours to code/test an extract like this. If you are looking for a contractor and are on Unix or Windows, please get in touch.

      Ragu Raghavan
      Raghavan@Inform-alServices.com
      You are not authorized to post a reply.