View previous topic :: View next topic
|
Author |
Message |
jm_green84
New User
Joined: 13 Dec 2006 Posts: 11 Location: ATL
|
|
|
|
I hav eto write a array using the following information, but I'm kinda lost and don't know where to start, any advice or input would help thanks.
Info
array meaning if a person has more than 1 row for the table each row needs to be loaded to an array field, Then output at the last row for the Person so that there is only one total row.
--------------
SSN
PRSN_INTN
PLAN_ID from PRSN_FSA_PLAN
PRSN_FSA_EFBEGDT from PRSN_FSA_PLAN
PRSN_FSA_EFENDDT from PRSN_FSA_PLAN
FSA_PLAN_AT from PRSN_FSA_PLAN
FSA_SRC_1_AT from PRSN_FSA_PLAN
(the above 4 fields pull 1 time each per row returned from PRSN_FSA_PLAN)
DED_ID from PRSN_DED
PRSN_DED_EFBEGDT from PRSN_DED
PRSN_DED_EFENDDT from PRSN_DED
DED_RPT_TS from PRSN_DED
DED_AT from PRSN_DED
(the above 4 fields pull 1 time each per row returned from PRSN_DED)
Example of a person have 2 PRSN_FSA_PLAN rows and 2 PRSN_DED rows...
SSN
PRSN_INTN
PLAN_ID from PRSN_FSA_PLAN
PRSN_FSA_EFBEGDT from PRSN_FSA_PLAN
PRSN_FSA_EFENDDT from PRSN_FSA_PLAN
FSA_PLAN_AT from PRSN_FSA_PLAN
FSA_SRC_1_AT from PRSN_FSA_PLAN
PRSN_FSA_EFBEGDT from PRSN_FSA_PLAN
PRSN_FSA_EFENDDT from PRSN_FSA_PLAN
FSA_PLAN_AT from PRSN_FSA_PLAN
FSA_SRC_1_AT from PRSN_FSA_PLAN
DED_ID from PRSN_DED
PRSN_DED_EFBEGDT from PRSN_DED
PRSN_DED_EFENDDT from PRSN_DED
DED_RPT_TS from PRSN_DED
DED_AT from PRSN_DED
PRSN_DED_EFBEGDT from PRSN_DED
PRSN_DED_EFENDDT from PRSN_DED
DED_RPT_TS from PRSN_DED
DED_AT from PRSN_DED |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Here's a code that builds and loads an array in SAS.
The array is built from multiple occurences of data on the same logical input record, but should be easy enough to change to build from consecutive records.
Code: |
DATA OUT01;
ARRAY TESTA(12) $ TESTA1-TESTA12
ARRAY TESTB(12) $ TESTB1-TESTB12
ARRAY TESTC(12) $ TESTC1-TESTC12
INFILE FILE1;
DO A = 1 TO 10;
POS = (A * 6) - 5;
INPUT @POS TESTA(A) $6.
@POS TESTB(A) $6.
@POS TESTC(A) $6. @;
END;
|
|
|
Back to top |
|
|
|