1097  filename dirtree url
1098      'https://raw.githubusercontent.com/sasutils/macros/master/dirtree.sas';
1099  %include dirtree /source2;
NOTE: %INCLUDE (level 1) file DIRTREE is file
      https://raw.githubusercontent.com/sasutils/macros/master/dirtree.sas.
1100 +%macro dirtree
1101 +/*---------------------------------------------------------------------------
1102 +Build dataset of files in directory tree(s)
1103 +----------------------------------------------------------------------------*/
1104 +(directory    /* Pipe delimited directory list (default=.) */
1105 +,out=dirtree  /* Output dataset name */
1106 +,maxdepth=120 /* Maximum tree depth */
1107 +);
1108 +/*---------------------------------------------------------------------------
1109 +Use SAS functions to gather list of files and directories
1110 +
1111 +directory - Pipe delimited list of top level directories
1112 +
1113 +out - Dataset to create
1114 +maxdepth - Maximum depth of subdirectories to query
1115 +
1116 +Output dataset structure
1117 +--NAME-- Len  Format      Description
1118 +FILENAME $256             Name of file in directory
1119 +TYPE       $1             File or Directory? (F/D)
1120 +SIZE        8 COMMA20.    Filesize in bytes
1121 +DATE        4 YYMMDD10.   Date file last modified
1122 +TIME        4 TOD8.       Time of day file last modified
1123 +DEPTH       3             Tree depth
1124 +PATH     $256             Directory name
1125 +
1126 +Size is not available for the directories.
1127 +LASTMOD timestamp is only available on Unix for directories.
1128 +
1129 +Will not scan the subtree of a directory with a path that is
1130 +longer then 256 bytes. For such nodes TYPE will be set to L .
1131 +
1132 +----------------------------------------------------------------------------*/
1133 +%local fileref ;
1134 +%let fileref=__FL__ ;
1135 +%if 0=%length(&directory) %then %let directory=. ;
1136 +
1137 +* Setup dataset and seed with starting directory list ;
1138 +data &out;
1139 +  length filename $256 type $1 size 8 date time 4 depth 3 path $256 ;
1140 +  retain filename ' ' depth 0 type ' ' date . time . size . ;
1141 +  format size comma20. date yymmdd10. time tod8. ;
1142 +  do _n_=1 to countw(symget('directory'),'|');
1143 +    path=scan(symget('directory'),_n_,'|');
1144 +    output;
1145 +  end;
1146 +run;
1147 +
1148 +%* Allow use of empty OUT= dataset parameter ;
1149 +%let out=&syslast;
1150 +
1151 +data &out;
1152 +  modify &out;
1153 +  retain sep "%sysfunc(ifc(&sysscp=WIN,\,/))";
1154 +  retain maxdepth &maxdepth;
1155 +* Create FILEREF pointing to current file/directory ;
1156 +  rc1=filename("&fileref",catx('/',path,filename));
1157 +  if rc1 then do;
1158 +    length message $256;
1159 +    message=sysmsg();
1160 +    put 'ERROR: Unable to create fileref for ' path= filename= ;
1161 +    put 'ERROR- ' message ;
1162 +    stop;
1163 +  end;
1164 +* Try to open as a directory to determine type ;
1165 +  did=dopen("&fileref");
1166 +  type = ifc(did,'D','F');
1167 +  if type='D' then do;
1168 +* Make sure directory name is not too long to store. ;
1169 +    if length(catx('/',path,filename)) > vlength(path) then do;
1170 +      put 'NOTE: Directory name too long. ' path= filename= ;
1171 +      type='L';
1172 +      rc3=dclose(did);
1173 +    end;
1174 +    else do;
1175 +* Move filename into the PATH and if on Unix set lastmod ;
1176 +      path=catx(sep,path,filename);
1177 +      filename=' ';
1178 +      if sep='/' then do;
1179 +        lastmod = input(dinfo(did,doptname(did,5)),nldatm100.);
1180 +        date=datepart(lastmod);
1181 +        time=timepart(lastmod);
1182 +      end;
1183 +    end;
1184 +  end;
1185 +  else do;
1186 +* For a file try to open file and get file information ;
1187 +    fid=fopen("&fileref",'i',0,'b');
1188 +    if fid then do;
1189 +      lastmod = input(finfo(fid,foptname(fid, 5)), nldatm100.);
1190 +      date=datepart(lastmod);
1191 +      time=timepart(lastmod);
1192 +      size = input(finfo(fid,foptname(fid,ifn(sep='/',6,4))),32.);
1193 +      rc2 = fclose(fid);
1194 +    end;
1195 +  end;
1196 +* Update the observation in the dataset ;
1197 +  replace;
1198 +  if type='D' then do;
1199 +* When current file is a directory add directory members to dataset ;
1200 +    depth=depth+1;
1201 +    if depth > maxdepth then put 'NOTE: ' maxdepth= 'reached, not reading members of ' path=
1201!+ ;
1202 +    else do i=1 to dnum(did);
1203 +      filename=dread(did,i);
1204 +      output;
1205 +    end;
1206 +    rc3=dclose(did);
1207 +  end;
1208 +* Clear the fileref ;
1209 +  rc4=filename("&fileref");
1210 +run;
1211 +
1212 +%mend dirtree;
NOTE: %INCLUDE (level 1) ending.
1213  %dirtree(C:\Users\bayzid\Macquarie University\MRFF Aged care Data - Documents\json_test
1213! /* Pipe delimited directory list (default=.) */
1214          , out=filelist  /* Output dataset name */
1215          , maxdepth=1 /* Maximum tree depth */);

NOTE: The data set WORK.FILELIST has 1 observations and 7 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

NOTE: The data set WORK.FILELIST has been updated.  There were 9 observations rewritten, 8
      observations added and 0 observations deleted.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

1216
1217  %macro read_json(myfile=);
1218      filename mydata &myfile.;
1219
1220      libname myjson JSON fileref=mydata filelockwait=600;;
1221
1222      proc datasets lib=myjson;
1223      quit;
1224
1225      *how to parse the file has not been specified - looks like you need to specify the
1225! lengths;
1226
1227      data file2save;
1228          length source $200. p1 $256. Value $256.;
1229          set myjson.alldata;
1230          source=&myfile.;
1231      run;
1232
1233      proc append base=master data=file2save force;
1234      run;
1235
1236      proc sql;
1237          drop table file2save;
1238      quit;
1239
1240      filename mydata;
1241      libname myjson;
1242  %mend read_json;
1243
1244  proc sql;
1245      drop table master;
NOTE: Table WORK.MASTER has been dropped.
1246  quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

1247
1248  data run_list;
1249      set filelist;
1250      where type='F';
1251      str=catt('%read_json(myfile="C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
1251! Documents\json_test', filename, '");');
1252      call execute(str);
1253  run;

NOTE: There were 8 observations read from the data set WORK.FILELIST.
      WHERE type='F';
NOTE: The data set WORK.RUN_LIST has 8 observations and 8 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

NOTE: CALL EXECUTE generated line.
NOTE: Line generated by the CALL EXECUTE routine.
1    + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
1   !+Documents\json_testMyDrug_5b056720-1620-4e67-9f42-7a0587da9a08.json";      libname myjson
1   !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds

2    + *how to parse the file has not been specified - looks like you need to specify the lengths;

2    +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
3    + care Data - Documents\json_testMyDrug_5b056720-1620-4e67-9f42-7a0587da9a08.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

3    +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: BASE data set does not exist. DATA file is being copied to BASE file.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

3    +
proc sql;
3    +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
3    +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

3    +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
3    +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
3    +
;
NOTE: Line generated by the CALL EXECUTE routine.
4    + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
4   !+Documents\json_testMyDrug_6af88da3-f0a8-46ef-8386-9eeac55a4a3a.json";      libname myjson
4   !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

5    + *how to parse the file has not been specified - looks like you need to specify the lengths;

5    +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
6    + care Data - Documents\json_testMyDrug_6af88da3-f0a8-46ef-8386-9eeac55a4a3a.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

6    +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

6    +
proc sql;
6    +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
6    +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

6    +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
6    +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
6    +
;
NOTE: Line generated by the CALL EXECUTE routine.
7    + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
7   !+Documents\json_testMyDrug_76de7937-695d-4981-84df-9cf34a029451.json";      libname myjson
7   !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

8    + *how to parse the file has not been specified - looks like you need to specify the lengths;

8    +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
9    + care Data - Documents\json_testMyDrug_76de7937-695d-4981-84df-9cf34a029451.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

9    +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

9    +
proc sql;
9    +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
9    +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

9    +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
9    +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
9    +
;
NOTE: Line generated by the CALL EXECUTE routine.
10   + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
10  !+Documents\json_testMyDrug_8c209d34-1b3c-48a5-ae3a-90763c4f4d2e.json";      libname myjson
10  !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

11   + *how to parse the file has not been specified - looks like you need to specify the lengths;

11   +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
12   + care Data - Documents\json_testMyDrug_8c209d34-1b3c-48a5-ae3a-90763c4f4d2e.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

12   +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

12   +
proc sql;
12   +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
12   +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

12   +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
12   +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
12   +
;
NOTE: Line generated by the CALL EXECUTE routine.
13   + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
13  !+Documents\json_testMyDrug_c97f2030-0603-4d97-98af-ea08fbdb2c9e.json";      libname myjson
13  !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

14   + *how to parse the file has not been specified - looks like you need to specify the lengths;

14   +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
15   + care Data - Documents\json_testMyDrug_c97f2030-0603-4d97-98af-ea08fbdb2c9e.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.03 seconds

15   +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

15   +
proc sql;
15   +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
15   +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

15   +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
15   +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
15   +
;
NOTE: Line generated by the CALL EXECUTE routine.
16   + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
16  !+Documents\json_testMyDrug_e64e0687-7c55-423e-acf0-e0b64387db89.json";      libname myjson
16  !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

17   + *how to parse the file has not been specified - looks like you need to specify the lengths;

17   +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
18   + care Data - Documents\json_testMyDrug_e64e0687-7c55-423e-acf0-e0b64387db89.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

18   +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

18   +
proc sql;
18   +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
18   +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

18   +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
18   +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
18   +
;
NOTE: Line generated by the CALL EXECUTE routine.
19   + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
19  !+Documents\json_testMyDrug_f2ae38cc-76ca-4b70-a833-9695db6feaea.json";      libname myjson
19  !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

20   + *how to parse the file has not been specified - looks like you need to specify the lengths;

20   +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
21   + care Data - Documents\json_testMyDrug_f2ae38cc-76ca-4b70-a833-9695db6feaea.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

21   +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

21   +
proc sql;
21   +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
21   +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.01 seconds

21   +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
21   +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
21   +
;
NOTE: Line generated by the CALL EXECUTE routine.
22   + filename mydata "C:\Users\bayzid\Macquarie University\MRFF Aged care Data -
22  !+Documents\json_testMyDrug_f2d360d2-d155-4c3c-8dba-5ea7f14b6158.json";      libname myjson
22  !+JSON fileref=mydata filelockwait=600;;      proc datasets lib=myjson;     quit;
                          ------------
                          22
ERROR: Libref MYJSON is not assigned.
ERROR: Error in the LIBNAME statement.
ERROR 22-7: Invalid option name FILELOCKWAIT.

ERROR: Libref MYJSON is not assigned.

NOTE: Statements not processed because of errors noted above.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE DATASETS used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

23   + *how to parse the file has not been specified - looks like you need to specify the lengths;

23   +
data file2save;         length source $200. p1 $256. Value $256.;         set myjson.alldata;
    source="C:\Users\bayzid\Macquarie University\MRFF Aged
ERROR: Libref MYJSON is not assigned.
24   + care Data - Documents\json_testMyDrug_f2d360d2-d155-4c3c-8dba-5ea7f14b6158.json";     run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set WORK.FILE2SAVE may be incomplete.  When this step was stopped there were 0
         observations and 3 variables.
NOTE: DATA statement used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds

24   +
proc append base=master data=file2save force;     run;

NOTE: Appending WORK.FILE2SAVE to WORK.MASTER.
NOTE: There were 0 observations read from the data set WORK.FILE2SAVE.
NOTE: 0 observations added.
NOTE: The data set WORK.MASTER has 0 observations and 3 variables.
NOTE: PROCEDURE APPEND used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

24   +
proc sql;
24   +
         drop table file2save;
NOTE: Table WORK.FILE2SAVE has been dropped.
24   +
     quit;
NOTE: PROCEDURE SQL used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds

24   +
      filename mydata;
NOTE: Fileref MYDATA has been deassigned.
24   +
     libname myjson;
WARNING: Libref MYJSON is not assigned.
24   +
;