Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Help writing a sas array

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
jm_green84

New User


Joined: 13 Dec 2006
Posts: 11
Location: ATL

PostPosted: Wed May 02, 2007 9:50 pm    Post subject: Help writing a sas array
Reply with quote

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
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu May 03, 2007 5:01 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Dynamic array request/response contai... Suja.Sai CICS 2 Tue Jan 24, 2017 11:37 am
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Easytrieve - Report writing - Only 1 ... Abhi Nature CA Products 2 Wed Sep 14, 2016 11:40 am
No new posts Unstring list of values into an array. Roshnii COBOL Programming 8 Mon Jun 27, 2016 6:25 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us