Reply To: Create a file

Product Compare Forums Multi-Edit User Created Macros Create a file Reply To: Create a file

#6887
Clay Martin
Keymaster

This is how I have gone about doing this (this code is after the check to see if it already exists)
[code:1o0w4zst]
/**Create the file – zero out if exists**/
int han;
int retval = S_CREATE_FILE(rcfile,han);

if ( retval != 0) {
messagebox(0,"Could not create file " + rcfile,"Macro Error: SASInitCfg",
mb_iconerror|mb_ok|mb_systemmodal);
goto Quit;
}
/**Close the file so it can be loaded**/
S_CLOSE_FILE(han);

/**Load the file **/
RM("LDFILES NR=1 /LC=1 /NHA=1 /FN="+rcfile); //PRE=1 removed
[/code:1o0w4zst]

The S_CREATE_FILE just makes the file, the LDFILES opens it in a window.

HTH,
Clay