<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Can Query Builder in SAS EG be used to output fixed-width columns? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750276#M235955</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386967"&gt;@Boswser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.The pathname(WORK) gives the full path&amp;nbsp; of your work directory/temp space.&amp;nbsp; This is a location on the server and not on desktop.&lt;BR /&gt;2.The full path of the work directory is a dynamic value and it changes with your session. Therefore you should only use the macro and not the physical name. Thus you have the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* This line extracts or finds the path*/
%let temp_path=%sysfunc(pathname(WORK));
/* when you want the filename use this :"&amp;amp;temp_path/my_file.txt" 
for example thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;  */
FILENAME Out_File "&amp;amp;temp_path/my_file.txt" LRECL=46;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3.Your SAS Server is on Unix and EG on your desktop. Your code executes on the server&lt;BR /&gt;Typically desktop locations under your scenario are not accessible to the code running ion the server.&lt;BR /&gt;Thus one cannot use desktop/laptops paths like c:\&lt;/P&gt;</description>
    <pubDate>Thu, 24 Jun 2021 18:26:02 GMT</pubDate>
    <dc:creator>Sajid01</dc:creator>
    <dc:date>2021-06-24T18:26:02Z</dc:date>
    <item>
      <title>Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749672#M235642</link>
      <description>Thanks for any help! I’ll try to be concise.&lt;BR /&gt;&lt;BR /&gt;I am new to SAS and have inherited a SAS run that outputs a table with 15 columns, which I export as an excel file and deliver.&lt;BR /&gt;&lt;BR /&gt;The recipient would now like it as a .txt file with fixed-width columns, and has provided the character limit/width for each column.&lt;BR /&gt;&lt;BR /&gt;Is this something that can be done in query builder, so I can just query the existing table rather than modifying the code in the run? I tried filling the field for ‘Length’ when you add a column to query builder, but it did not have the desired result.&lt;BR /&gt;&lt;BR /&gt;I have attempted to use filename and PUT statements to output a .txt file, but am running into access issues I’m currently working on with the admin team. I’m hoping I can just do this in query builder to get it done but I’m not sure if it’s possible to have QB output a results table with fixed width columns?</description>
      <pubDate>Tue, 22 Jun 2021 19:03:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749672#M235642</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-22T19:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749767#M235687</link>
      <description>&lt;P&gt;If you're exporting to an Excel file, why not just export from Excel as fixed length/fixed position text?&amp;nbsp; Excel likes to do csv or tab delimited text, but you can export it to a .prn file which is space filled and then rename it to .txt.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1624413007157.png" style="width: 999px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60641i6687557CDAFA8585/image-size/large?v=v2&amp;amp;px=999" role="button" title="jimbarbour_0-1624413007157.png" alt="jimbarbour_0-1624413007157.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 01:50:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749767#M235687</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-23T01:50:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749775#M235692</link>
      <description>Thank you Jim. The file is written to a specific shared folder so it can be automatically picked up by another process, which is why it needs the fixed widths. So we want it to export right from SAS EG and into that shared folder.</description>
      <pubDate>Wed, 23 Jun 2021 03:37:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749775#M235692</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-23T03:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749780#M235696</link>
      <description>&lt;P&gt;Well, SAS can definitely do it.&amp;nbsp; It's been a while since I've had the occasion, but you'd set up FILENAME before a Data step.&amp;nbsp; In your Data step, you'd have a FILE statement corresponding to the FILENAME.&amp;nbsp; Then you'd use the Put command to write to the file with the&amp;nbsp;@ symbol to position the pointer to where you want each column.&amp;nbsp; This will give you fixed width columns and a fixed length output record.&amp;nbsp; Something along the lines of the below.&amp;nbsp; The&amp;nbsp;@ followed by the number starts each column, and the LRECL (logical record length) sets the overall length of the output record.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME Out_File 'C:\my_directory\my_file.txt' LRECL=46;

Data _NULL_;
    Set  Have;
    File Out_File;
    Put  @1  ID
            @10  First_Name
            @35  Middle_Initial
            @36  Last_Name
             ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Obviously, that's not using Query Builder, but that's how I would build a fixed position text output file.&amp;nbsp; It's really a pretty easy piece of code.&amp;nbsp; Maybe you could get Query Builder to do it, but that's really not what Query Builder is for.&amp;nbsp; A Data step is ideal for what you want to do.&amp;nbsp; Using Query Builder is like putting a round peg in a square hole.&amp;nbsp; If you pound on it hard enough, it may eventually work, but it's a lot easier if you just use a peg that is the same shape as the hole.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 04:52:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749780#M235696</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-23T04:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749939#M235789</link>
      <description>Thanks Jim! The filename data step is the solution I am currently working on. I am running into permission issues when trying to write a file directly from the SAS program, rather than exporting the results to a file within SAS EG.&lt;BR /&gt;&lt;BR /&gt;The error I get is: Insufficient authorization to access /opt/sas/sas_control/config/Lev1/SASApp/C:\Users\ShaneLu\Desktop\testfile.txt&lt;BR /&gt;&lt;BR /&gt;I am currently working with my IT team to see if there is an access/permission they can give me so that I can get this to work.&lt;BR /&gt;&lt;BR /&gt;Are you aware of any way circumvent this so I can write the file to my desktop? I want to put it there first so I can make sure it’s outputting correctly, before I change the output path to the desired folder.</description>
      <pubDate>Wed, 23 Jun 2021 18:29:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749939#M235789</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-23T18:29:44Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749941#M235790</link>
      <description>Or, alternatively, anything in the EXPORT step in SAS EG that could output a fixed-width file?&lt;BR /&gt;&lt;BR /&gt;Unfortunately the current issues I’m running into involve that error I mentioned above when trying to write a file using just the SAS Program. I was hoping to find a way to circumvent that, as I don’t know how long IT will take to fix this, or if they even can.</description>
      <pubDate>Wed, 23 Jun 2021 18:32:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749941#M235790</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-23T18:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749943#M235791</link>
      <description>&lt;P&gt;Looks like your SAS server is on a Unix/Linux machine and you are trying to save file on your windows desktop./laptop.&lt;BR /&gt;Try saving the file into your workspace on the Linux machine. The following code will give the path of your workspace on server. Anything here would disappear&amp;nbsp;once your session closes.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let temp_path=%sysfunc(pathname(WORK));
%put &amp;amp;=temp_path;&lt;BR /&gt;/*&amp;nbsp;save&amp;nbsp;your&amp;nbsp;file&amp;nbsp;to&amp;nbsp;&amp;amp;temp_path./your_file.txt&amp;nbsp;*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can save your file to the above location&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 18:40:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/749943#M235791</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-06-23T18:40:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750034#M235846</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386967"&gt;@Boswser&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Or, alternatively, anything in the EXPORT step in SAS EG that could output a fixed-width file?&lt;BR /&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;As a matter of fact there is.&amp;nbsp; Click on "Share" in the Output window, then "Export", just as you normally would, but for the file type, select Text (space delimited).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1624483254484.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60685i0DAE920965A246D6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1624483254484.png" alt="jimbarbour_0-1624483254484.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now, will that allow you to precisely plot the widths of each column and the position where each column starts?&amp;nbsp; I believe it will, but you would have to set widths of the columns via FORMAT statements for each variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 21:24:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750034#M235846</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-23T21:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750047#M235852</link>
      <description>&lt;P&gt;Well, crap.&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I just tried my Export idea, and it doesn't work.&amp;nbsp; It produces space&amp;nbsp;&lt;EM&gt;delimited&lt;/EM&gt; but not fixed position text.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you have to use the FILENAME - FILE set up I explained earlier.&amp;nbsp; As&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/131732"&gt;@Sajid01&lt;/a&gt;&amp;nbsp;pointed out, you should have permission to write to your WORK directory.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can find your work directory as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC OPTIONS OPTION=WORK;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You should get something like this in your log:&lt;/P&gt;
&lt;PRE&gt;    SAS (r) Proprietary Software Release 9.4  TS1M6

 WORK=X:\saswork\jbarbour\_TD56672_APSWP2335_\Prc2
                   Specifies the libref or location of the Work library.
&lt;/PRE&gt;
&lt;P&gt;Cut and paste the WORK=xxxxx that it gives you.&amp;nbsp; In my case it is&amp;nbsp;X:\saswork\jbarbour\_TD56672_APSWP2335_\Prc2 into that FILENAME that I mentioned earlier as in the below.&amp;nbsp; This is just an example, you'll have to use real column names and formats, of course.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FILENAME Out_File 'X:\saswork\jbarbour\_TD56672_APSWP2335_\Prc2' LRECL=46;

Data _NULL_;
    Set  Have;
    File Out_File;
    Put     @1  ID
            @10  First_Name
            @35  Middle_Initial
            @36  Last_Name
             ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Once you create the file, you will need to download it from your SAS server to your machine.&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;Do &lt;EM&gt;not&lt;/EM&gt; close your SAS EG session &lt;/STRONG&gt;until you have downloaded the file.&amp;nbsp; Typically, WORK locations are deleted/cleaned up when the session terminates.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 22:26:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750047#M235852</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-23T22:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750214#M235921</link>
      <description>Thanks again Jim! I am definitely making progress here.&lt;BR /&gt;&lt;BR /&gt;So the good news is—that worked to get me a file! I’m able to write to the work folder.&lt;BR /&gt;&lt;BR /&gt;***(EDIT because I realized I was using PUT incorrectly, updated the code below)&lt;BR /&gt;&lt;BR /&gt;This is my code:&lt;BR /&gt;&lt;BR /&gt;filename out_file “/sas/work/saswork3/SAS_work21C400006785_dr877/SAS_workA1B200006785_dr877/testfile.txt&lt;BR /&gt;&lt;BR /&gt;DATA FIXEDTEXTFILE;&lt;BR /&gt;SET work.results;&lt;BR /&gt;&lt;BR /&gt;FILE out_file;&lt;BR /&gt;&lt;BR /&gt;PUT&lt;BR /&gt;@1 ID_NB&lt;BR /&gt;@27 CMPY&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/75109"&gt;@30&lt;/a&gt; AREA_SZ_RT_CD&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/365854"&gt;@34&lt;/a&gt; EF_DT&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/141242"&gt;@44&lt;/a&gt; STSTC_RPRT_LT&lt;BR /&gt;@48 ADRS_LN_1&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/94349"&gt;@89&lt;/a&gt; CTY_NM&lt;BR /&gt;@120 ST_CD&lt;BR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/9435"&gt;@123&lt;/a&gt; PSTL_ZIP&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;BR /&gt;&lt;BR /&gt;The only thing is, I need that last column—PSTL_ZIP—to be a fixed-width of 9. How do I make that happen?</description>
      <pubDate>Thu, 24 Jun 2021 14:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750214#M235921</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-24T14:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750220#M235923</link>
      <description>&lt;P&gt;First the EXPORT menu in EG does not appear to support fixed position file generation.&lt;/P&gt;
&lt;P&gt;Second your data step is confused, for example you are overwriting the value of CMPY with the value of ST_CD since you are writing both starting in the second character of the line.&lt;/P&gt;
&lt;P&gt;It will be easier if you list the variables in the order that you want them to appear in the text file.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might be easier to just use formats instead of the&amp;nbsp;@ notation.&amp;nbsp;&amp;nbsp;&lt;SPAN style="font-family: inherit;"&gt;For example if CMPY is supposed to be one character field then use a format with a width of one.&amp;nbsp; If it is character use $1. as the format and if it is a numeric variable just use 1. instead.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="inherit"&gt;But you can mix them.&amp;nbsp; For example if there is large difference between the number of characters on the line reserved for the variable and the length of the &lt;/FONT&gt;values&lt;FONT face="inherit"&gt;&amp;nbsp;you want to write.&amp;nbsp; So you wanted the DATE starting at column 1 and the NAME starting at column 20, but you are writing the dates using the DATE9. format.&amp;nbsp; Then you want 11 spaces between the end of the date value and the start of the name value.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;put date date9. @20 name $30. .....&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="inherit"&gt;Or if the values you have for a variable is longer than the space reserved for it in the fixed format you are generating then you will need to use a format to limit the number of character written.&amp;nbsp; For example if your NAME field has values that are longer than 30 characters if you just write it with&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;@20 name&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;FONT face="inherit"&gt;it might write some characters past column 50 and into the space reserved for the next field.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="inherit"&gt;Finally you need a method to move the file from your SAS server to the location you really want to put it.&amp;nbsp; You can use the file download task in Enterprise Guide to copy it to your local machine.&amp;nbsp; &amp;nbsp;Or you can ask the SAS administrator to mount the shared file location you want to write the file to as a Unix folder on the server where SAS runs.&amp;nbsp; Then you could write directly to that folder instead of writing to some &lt;/FONT&gt;temporary&lt;FONT face="inherit"&gt;&amp;nbsp;file and downloading it.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:38:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750220#M235923</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-24T14:38:37Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750225#M235927</link>
      <description>&lt;P&gt;If&amp;nbsp;&lt;SPAN&gt;PSTL_ZIP is character use $9. format.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 14:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750225#M235927</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-06-24T14:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750227#M235929</link>
      <description>Thanks Tom—I realized what you pointed out as soon as I replied, then fixed my code and edited the post. I appreciate it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;So as you mentioned, I now have the issue of trying to get this file off the SAS server and where it needs to be. Ideally we want this to be an automated process.&lt;BR /&gt;&lt;BR /&gt;I am pretty new to SAS and SAS EG—can I insert a step into this run that plucks the file out of the WORK folder it ends up in, and deposits it somewhere else (in my case, this would be a shared folder my team and their team can access)?</description>
      <pubDate>Thu, 24 Jun 2021 14:47:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750227#M235929</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-24T14:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750233#M235932</link>
      <description>&lt;P&gt;You should be able to schedule a Copy Files task as part of your EG Process Flow.&amp;nbsp; Copy Files can both upload and download, so be sure to check the right boxes when you set it up.&amp;nbsp; You'll also need to check "Fix line ending characters..." (see screen print, below).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_0-1624548033801.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60724i99B8F231AE997FBA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_0-1624548033801.png" alt="jimbarbour_0-1624548033801.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jimbarbour_1-1624548204383.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60725i52150A73752C71A9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jimbarbour_1-1624548204383.png" alt="jimbarbour_1-1624548204383.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 15:24:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750233#M235932</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-24T15:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750252#M235939</link>
      <description>This function definitely seems like what I want! I tested it and it works to get the file to my desktop. But...sadly there is a different issue.&lt;BR /&gt;&lt;BR /&gt;My .txt file is written to the temp folder in WORK. I just realized that the name of WORK’s folders change slightly every time I close and reopen the program, and thus the filename path in my code no longer works. To fix, I have to manually run the PROC OPTIONS step to get the new name of the WORK path, and replace it in the FILENAME part of my code. So of course that won’t work if we want this to be automated &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Is there anywhere I can write this file to where the folder name won’t change every time I open the program? The goal is to run this automatically via Windows Task Scheduler, so really this process flow should never be open (unless I need to change something). If it’s not open, does the WORK folder even exist?&lt;BR /&gt;&lt;BR /&gt;Alternatively, is there something I can write into the code that will always grab whatever the existing WORK filepath happens to be at that time? Or even...run the PROC OPTIONS program separately, then have my filename program use the specific “WORK=“ result that it generates?</description>
      <pubDate>Thu, 24 Jun 2021 16:23:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750252#M235939</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-24T16:23:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750254#M235940</link>
      <description>&lt;P&gt;Please have a look at my post that is at the end of this thread. There is no need to use proc options.&lt;/P&gt;
&lt;P&gt;That approach is used all the time.&lt;/P&gt;
&lt;P&gt;Changing folder names/ locations will not have any impact.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 16:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750254#M235940</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-06-24T16:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750259#M235942</link>
      <description>Thank you Sajid, sorry I missed this response!&lt;BR /&gt;&lt;BR /&gt;So I’m definitely new to macros, bear with me. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I’m not exactly sure what values to put where. Does this look correct?&lt;BR /&gt;&lt;BR /&gt;%let temp_path=%sysfunc(/sas/work/saswork3/SAS_work21C400006785_dr877/SAS_workA1B200006785_dr877/TESTFILE.txt(WORK));&lt;BR /&gt;&lt;BR /&gt;(And sorry—not sure what I should be replacing with what in this second part?)&lt;BR /&gt;&lt;BR /&gt;%put &amp;amp;=temp_path;/* save your file to &amp;amp;temp_path./your_file.txt *</description>
      <pubDate>Thu, 24 Jun 2021 17:13:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750259#M235942</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-24T17:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750265#M235948</link>
      <description>&lt;P&gt;It might look something like the below.&amp;nbsp; Notice the change I made to the FILENAME.&amp;nbsp; The path is brought in via a macro variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let temp_path=%sysfunc(pathname(WORK));
%put &amp;amp;=temp_path;

FILENAME Out_File "&amp;amp;temp_path/my_file.txt" LRECL=46;

Data _NULL_;
    Set  Have;
    File Out_File;
    Put  @1  ID
            @10  First_Name
            @35  Middle_Initial
            @36  Last_Name
             ;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Jim&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 17:38:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750265#M235948</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-24T17:38:29Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750267#M235949</link>
      <description>Thanks Jim! I guess the part I am confused about is what (if anything) I am replacing “PATHNAME” with.&lt;BR /&gt;&lt;BR /&gt;Should I replace it with “/sas/work/saswork3/SAS_work21C400006785_dr877/SAS_workA1B200006785_dr877/TESTFILE.txt”, with the desktop filepath (C:\Users...etc), or just call it whatever I want?</description>
      <pubDate>Thu, 24 Jun 2021 17:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750267#M235949</guid>
      <dc:creator>Boswser</dc:creator>
      <dc:date>2021-06-24T17:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Can Query Builder in SAS EG be used to output fixed-width columns?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750276#M235955</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/386967"&gt;@Boswser&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1.The pathname(WORK) gives the full path&amp;nbsp; of your work directory/temp space.&amp;nbsp; This is a location on the server and not on desktop.&lt;BR /&gt;2.The full path of the work directory is a dynamic value and it changes with your session. Therefore you should only use the macro and not the physical name. Thus you have the following&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* This line extracts or finds the path*/
%let temp_path=%sysfunc(pathname(WORK));
/* when you want the filename use this :"&amp;amp;temp_path/my_file.txt" 
for example thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/37107"&gt;@jimbarbour&lt;/a&gt;&amp;nbsp;  */
FILENAME Out_File "&amp;amp;temp_path/my_file.txt" LRECL=46;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3.Your SAS Server is on Unix and EG on your desktop. Your code executes on the server&lt;BR /&gt;Typically desktop locations under your scenario are not accessible to the code running ion the server.&lt;BR /&gt;Thus one cannot use desktop/laptops paths like c:\&lt;/P&gt;</description>
      <pubDate>Thu, 24 Jun 2021 18:26:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Can-Query-Builder-in-SAS-EG-be-used-to-output-fixed-width/m-p/750276#M235955</guid>
      <dc:creator>Sajid01</dc:creator>
      <dc:date>2021-06-24T18:26:02Z</dc:date>
    </item>
  </channel>
</rss>

