Obviously, the forum's data2datastep macro needs a little more work, as it is currently unable to transform your dataset into a readable datastep.
Below is code that does present your data as a readable datastep. However, I still want to know what you want the resulting long file to look like. I'd even accept an excel version of that desired result.
data WORK.BACT_ALL_HAVE;
infile datalines4 dsd dlm=',' truncover;
input patientid affiliationid: contamination sex samplenr_11:$21.
samplenr_12:$21. samplenr_13:$27. samplenr_14:$21. samplenr_15:$11.
samplenr_16:$14. samplenr_17:$14. samplenr_18:$19. samplenr_21:$14.
samplenr_22:$19. samplenr_23:$11. samplenr_24:$1. samplenr_31:$19.
samplenr_32:$17. samplenr_33:$1. samplenr_41:$15. samplenr_42:$18.
samplenr_43:$14. samplenr_44:$14. infection;
label patientid="patientid" affiliationid="affiliationid"
contamination="contamination" sex="sex" samplenr_11="samplenr_11"
samplenr_12="samplenr_12" samplenr_13="samplenr_13"
samplenr_14="samplenr_14" samplenr_15="samplenr_15"
samplenr_16="samplenr_16" samplenr_17="samplenr_17"
samplenr_18="samplenr_18" samplenr_21="samplenr_21"
samplenr_22="samplenr_22" samplenr_23="samplenr_23"
samplenr_24="samplenr_24" samplenr_31="samplenr_31"
samplenr_32="samplenr_32" samplenr_33="samplenr_33"
samplenr_41="samplenr_41" samplenr_42="samplenr_42"
samplenr_43="samplenr_43" samplenr_44="samplenr_44"
infection="infection";
datalines4;
522, 22752, 1, 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
708, 22752, 1, 2, "Micrococcus", "Micrococcus", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
958, 69167, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
983, 22752, 1, 2, "Staph. epidermidis", "Micrococcus", "Moraxella species", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1391, 22752, 1, 1, "Staph. epidermidis", "Staph. epidermidis", "Coryne bacterium spp.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 2
1412, 22752, 1, 2, "Staph. epidermidis", "Staph. hominis", "Staph. hominis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1421, 22752, 1, 2, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1475, 22752, 2, 2, "Coryne bacterium spp.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1642, 22752, 1, 1, "Staph. capitis", "Staph. epidermidis", "Staph. hominis", "Staph. warneri", "Micrococcus", "", "", "", "", "", "", "", "Staph. epidermidis", "Bacillus subtilis", "", "", "", "", "", 1
1684, 22752, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1735, 22752, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
1755, 22752, 2, 2, "staph epidermidis", "", "", "", "", "", "", "", "Moraxella spp.", "staph. Hominis", "Micrococcus", "", "staph. Capitis", "", "", "Aerococcus spp.", "staph. Epidermidis", "staph. Hominis", "staph. Capitis", 2
1863, 72911, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 2
1998, 69167, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 2
2008, 69167, 1, 2, "CoNS", "Coryne bacterium spp.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
2269, 69167, 1, 2, "Staph. haemolyticus", "Staph. hominis", "Micrococcus", "Coryne bacterium spp.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
2308, 69167, 1, 2, "Staph. hominis", "Micrococcus", "Coryne bacterium spp.", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
2362, 22752, 1, 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 2
2510, 22752, 2, 2, "", "", "", "", "", "", "", "", "Staph. capitis", "Staph. Haemolyticus", "", "", "Staph. Haemolyticus", "", "", "", "", "", "", 1
2559, 22752, 1, 2, "Staph. hominis", "Micrococcus", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
2570, 22752, 1, 2, "Staph. hominis", "Bacillus species", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
2873, 22752, 2, 2, "Coryne bacterium spp.", "Micrococcus", "", "", "", "", "", "", "CoNS", "Staph. epidermidis", "CoNS", "", "Strep. Dysgalactiae", "", "", "", "", "", "", 1
2938, 22752, 1, 1, "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 2
3030, 22752, 2, 1, "", "", "", "", "", "Staph. capitis", "Staph. hominis", "staph. haemolyticus", "Staph. capitis", "", "", "", "", "", "", "Staph. capitis", "", "", "", 1
3035, 69167, 1, 1, "CoNS", "Staph. capitis", "Acinetobacter (ssp. lwoffi)", "Staph. capitis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
3116, 69167, 1, 1, "staph epidermidis", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", 1
;;;;
run;
Art, CEO, AnalystFinder.com
... View more