Format File for SAS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • neil_sm
    New User
    • Jul 2013
    • 2

    Format File for SAS

    ***EDIT 7/12/2013 I replaced the format file with a new version. See post #3 below

    I couldn't find any BC format for SAS, so I created one and thought I'd share it here. Basically I copied keywords, operators, procedures and other info out of an Ultraedit Wordfile for SAS 9.1.3. For all intents and purposes this should work fine for whatever version of SAS you're using.

    I should note that I added some custom grammar element names like "SAS Procedure" and a few others. And much other stuff just got bundled into keywords.

    So what you want to do is go to Tools->Options... File Views->Display and from there you will find the newly named elements and can set the formatting however you'd like.

    I attempted to export the settings too so the formatting for the custom elements could be automatically imported, but I really didn't want to send my whole settings file. One thing I tried to do was edit the XML file so it only contained the relevant tags for the File Views. So it looked something like:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Produced by Beyond Compare 3 from Scooter Software -->
    <BCPreferences>
    		<TFilePrefs>
    		<AlignedColor Value="$FFFF00"/>
    		<BGColor Value="$FF000005"/>
    		<CenterColor Value="$2585B8"/>
    		<CheckForChanges Value="True"/>
    		<CheckForChangesAutoReload Value="False"/>
    		<CompareAsMerge Value="False"/>
    		<ConflictHueShift Value="3"/>
    		<CurBGColor Value="-"/>
    		<CurFGColor Value="-"/>
    		<CurOverUnderOnly Value="False"/>
    		<DiffShift Value="0"/>
    		<DimPct Value="20"/>
    		<EditedColor Value="$6CE9FF"/>
    		<EditorFontStr Value=""/>
    		<ElementPSs>
    			<Item>
    				<ElementStr Value="SAS Procedure"/>
    				<ValueStr Value="$FF0000"/>
    			</Item>
    <!--and so on for the rest of TFilePrefs -->
    But when I tested an import, what it did was erase (set to default) all of the other options that were left out of the xml -- which is obviously not what anyone wants to happen.

    Maybe someone knows a way around that problem? Otherwise, not that important.

    This is my first time working with BC file format rules so I sort of muddled my way through it. I just copied the regex for numbers from Perl or something. Close enough, I'm sure.


    Anyway, I hope this helps some of the other BC users who use SAS. There's got to be at least 5-6 other people in that subset!
    Last edited by neil_sm; 12-Jul-2013, 12:29 PM. Reason: REMOVED OUTDATED ATTACHMENT - UPDATED VERSION POSTED BELOW
  • Aaron
    Team Scooter
    • Oct 2007
    • 16017

    #2
    Thanks for the post. I'm sure other users will find this useful.

    Do you have any example files you would like to include or email to [email protected]? We could review the format with the examples and maybe post it on our File Format downloads page. If you email us, please include a link to this forum thread.
    Aaron P Scooter Software

    Comment

    • neil_sm
      New User
      • Jul 2013
      • 2

      #3
      Thanks!

      First of all, I'm attaching an updated version here.

      The main difference is this contains a new category called "SAS Formats". The old version had them as keywords, but the format specifiers needed regex because they can look like:

      comma
      comma9.2
      comma.
      comma9.

      So I thought that made a big difference.

      I am emailing some sample files also...

      Comment

      • Claudia
        New User
        • Apr 2015
        • 1

        #4
        SAS File Format

        Originally posted by Aaron
        Thanks for the post. I'm sure other users will find this useful.

        Do you have any example files you would like to include or email to [email protected]? We could review the format with the examples and maybe post it on our File Format downloads page. If you email us, please include a link to this forum thread.
        Is there a status on having a formal SAS format on the File Format Downloads? I''m a new SAS developer and will find this feature very helpful.

        thank you.

        Comment

        • Aaron
          Team Scooter
          • Oct 2007
          • 16017

          #5
          Hello,

          We received a couple sample files, but have not had time to properly review it. If you have any feedback on the format posted here, we'd be appreciative to know if it needs any tweaking or if it seems good to go.
          Aaron P Scooter Software

          Comment

          Working...