0
votes

I have a dataset That is set up as follows:

Standard

  129 106 122 114 121 111 135 106 122 148 102 121 129 101 109 123 109 123 101 119
  138 151 137 116 118 118 143 104 119 113 121  98 116 103 132 113 105 127 113 118 
  109  94 110 119 125 105 106 131 104 126 122 106 118 123 110 134 138 135 131 116 
  117 123 103 111 120 137 106 112 100 112 128 102 116 118 140  97 122 133 129 127 
  120 120 127 136 123 112  99 124 129 116 127 123 131 127 109  99 134 128 109 129

New

  112 101 109 124 131  97  98 106 115 119 116 125 108 116 111 121 109 124 120  96 
  102 130 106 112 115 111 122 106 107 109 115 104 125 114 135 127 117 113  98  95 
  121 116 111 116 118 112 117 114 128 125 104 118 122 123 124 119 110  96 123 124 
  127 100 121 108 133 118 114 116 125 118 137 115 131 108 100 121 113 116 104 101 
  126 123 135 116 118 111 101 118 111 125 104 124 132 121 114 132 123 121 121 110

I have only ever read in data to SAS that was in column form. I tried to set it up as two separate raw datasets one Standard, one New and then merge the two.

data blood1;
    input Standard;
    datalines;
    129 106 122 114 121 111 135 106 122 148 102 121 129 101 109 123 109 123 101 119
      138 151 137 116 118 118 143 104 119 113 121  98 116 103 132 113 105 127 113 118 
      109  94 110 119 125 105 106 131 104 126 122 106 118 123 110 134 138 135 131 116 
      117 123 103 111 120 137 106 112 100 112 128 102 116 118 140  97 122 133 129 127 
       120 120 127 136 123 112  99 124 129 116 127 123 131 127 109  99 134 128 109 129
      ;

But this only reads the first number of each row. what would be the best way to read this data in?

1
Are the two files related in some way? Do you need to match up the two files by position? Or are they two different samples?Tom

1 Answers

0
votes

You need to add @@ to the input statement. That tells SAS not to advance the line pointer after each read.

data blood1;
    input Standard @@;
    datalines;
    129 106 122 114 121 111 135 106 122 148 102 121 129 101 109 123 109 123 101 119
      138 151 137 116 118 118 143 104 119 113 121  98 116 103 132 113 105 127 113 118 
      109  94 110 119 125 105 106 131 104 126 122 106 118 123 110 134 138 135 131 116 
      117 123 103 111 120 137 106 112 100 112 128 102 116 118 140  97 122 133 129 127 
       120 120 127 136 123 112  99 124 129 116 127 123 131 127 109  99 134 128 109 129
      ;