<?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: Creating a file of bypassed records from reading an input file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932518#M366839</link>
    <description>&lt;P&gt;I was able to work through a couple iterations of it and got past those file-related errors.&lt;BR /&gt;&lt;BR /&gt;The code thus far is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;  IF component_status = 'I' THEN DO;
    FILE bypass;
    PUT
      @ 00001 record       $CHAR8.
    ;
    END;
    ELSE DO;
    FILE inputf
    PUT 
        @ 00001  lots of fields
        ;
  END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For whatever reason the record meeting the IF criteria is still getting into the other file.&amp;nbsp; I want it just in the bypass file, and to be excluded from the data flowing in via the input file...I thought the IF condition would exclude it from going into the PUT for the other file.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2024 21:28:24 GMT</pubDate>
    <dc:creator>BeerSultan</dc:creator>
    <dc:date>2024-06-14T21:28:24Z</dc:date>
    <item>
      <title>Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932464#M366819</link>
      <description>&lt;P&gt;Brand new to SAS.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing something that I expect is relatively easy, but I'm struggling to get it right.&amp;nbsp; The requirement is basic - I'm reading in a long file with many rows, if a record matches a criteria I want it to be shipped to a different "bypass" file that I'll work on in a later process, but it should be removed from the original read-in file.&lt;BR /&gt;&lt;BR /&gt;Environment is zOS - input file is defined and passed in via JCL (all working).&lt;BR /&gt;I get the following errors if I remove my actual logic - if I leave the FILENAME statement in without referencing it there's no errors.&lt;BR /&gt;ERROR: Invalid logical name.&lt;BR /&gt;ERROR: Error in the FILENAME statement.&lt;BR /&gt;ERROR: Invalid file, BYPASS_FILE.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;FILENAME BYPASS_FILE BYPASS1;

/***********************************************************/
/* READ FILE */
/***********************************************************/
DATA DATAIN;
INFILE DATAIN;
INPUT
@ 00001 RECORD_NUMBER $CHAR8.
@ 01769 COMPONENT_STATUS $CHAR1.
;

/*******************************************************************/
/* CREATE BYPASS FILE - USED TO STORE RECORDS WHICH HAVE AN */
/* INACTIVE COMPONENT: COMPONENT_STATUS = I */
/*******************************************************************/
IF COMPONENT_STATUS = 'I' THEN DO;
 FILE BYPASS_FILE;
 PUT;
 DELETE;
END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 19:05:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932464#M366819</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-14T19:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932466#M366821</link>
      <description>&lt;P&gt;I am not quite sure, but the message "&lt;SPAN&gt;Invalid logical name" sounds like it is the name "BYPASS_FILE" that is too long. It may be possible to have filename references in SAS (depending on the version) that are more than 8 characters, but if it gets passed to z/OS as a file reference/DD name, it probably won't work. Try using a shorter name, e.g. "BP_FILE".&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 19:07:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932466#M366821</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2024-06-14T19:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932479#M366830</link>
      <description>Yeah - no luck. Still giving invalid error.</description>
      <pubDate>Fri, 14 Jun 2024 19:57:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932479#M366830</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-14T19:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932483#M366834</link>
      <description>&lt;P&gt;The parameter of a FILE statement must either be a file reference (without quotes) created with a FILENAME statement or coming from the JCL, or a physical path name enclosed in quotes.&lt;/P&gt;
&lt;P&gt;Since you did not use quotes, the file reference must be 8 or less characters long, and must have been defined upstream (in the JCL or SAS code).&lt;/P&gt;
&lt;P&gt;If you want to supply a physical name, it must meet the requirements of z/OS.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 20:36:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932483#M366834</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-14T20:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932518#M366839</link>
      <description>&lt;P&gt;I was able to work through a couple iterations of it and got past those file-related errors.&lt;BR /&gt;&lt;BR /&gt;The code thus far is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;  IF component_status = 'I' THEN DO;
    FILE bypass;
    PUT
      @ 00001 record       $CHAR8.
    ;
    END;
    ELSE DO;
    FILE inputf
    PUT 
        @ 00001  lots of fields
        ;
  END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For whatever reason the record meeting the IF criteria is still getting into the other file.&amp;nbsp; I want it just in the bypass file, and to be excluded from the data flowing in via the input file...I thought the IF condition would exclude it from going into the PUT for the other file.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2024 21:28:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932518#M366839</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-14T21:28:24Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932519#M366840</link>
      <description>I do have it coming via JCL and it's named accordingly. I ended up abandoning using the FILENAME approach altogether...I don't know how to make it work that way.&lt;BR /&gt;&lt;BR /&gt;BYPASS DD DSN=XY.#xyz1234.TEST.DATA.BYPASS,&lt;BR /&gt;DISP=(NEW,CATLG,DELETE),UNIT=TST1,&lt;BR /&gt;DATACLAS=FXB080CP,LRECL=40,&lt;BR /&gt;SPACE=(40,(1,1),RLSE),AVGREC=K</description>
      <pubDate>Fri, 14 Jun 2024 21:31:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932519#M366840</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-14T21:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932522#M366842</link>
      <description>Please tell us this is just a typo and you really do have a semicolon after &lt;BR /&gt;&lt;BR /&gt;FILE inputf</description>
      <pubDate>Sat, 15 Jun 2024 06:56:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932522#M366842</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2024-06-15T06:56:50Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932523#M366843</link>
      <description>&lt;P&gt;As soon as a FILE statement executes, it opens the file,&amp;nbsp;&lt;EM&gt;and the file is kept open&lt;/EM&gt;. Multiple FILE statements mean multiple concurrent destinations.&lt;/P&gt;
&lt;P&gt;The&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n15o12lpyoe4gfn1y1vcp6xs6966.htm" target="_blank" rel="noopener"&gt;FILE Statement&lt;/A&gt;&amp;nbsp;documentation shows how the output file can be changed with the FILEVAR= option, but you have to use physical names in this variable, not file references.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 06:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932523#M366843</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-15T06:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932542#M366853</link>
      <description>&lt;P&gt;The indentation is a little messed up but it looks like you are just missing s semicolon.&lt;/P&gt;
&lt;PRE&gt;data _null_;
  set have;
  IF component_status = 'I' THEN DO;
    FILE bypass;
    PUT
      @ 00001 record       $CHAR8.
    ;
  END;
  ELSE DO;
    FILE inputf;
    PUT 
        @ 00001  lots of fields
    ;
  END;
run;&lt;/PRE&gt;
&lt;P&gt;So that code is WRITING from a DATASET to a FILE.&amp;nbsp; Which is not the impression I got from your original post.&amp;nbsp; It sounded more to me like you were trying to READ from a file and spit out the other LINES from the file to a separate file.&lt;/P&gt;
&lt;P&gt;So a data step like this will create WANT dataset from the input file IN.&amp;nbsp; It will check something on the line and decide whether it should write that line to the OUT text file or continue with the rest of the data step that reads the line and does any other things like calculating any derived variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile IN ;
  file OUT ;
  input @1 check $ @1 @ ;
  if check='X' then do;
     put _infile_;
     delete;
  end;
  input ....;
  ....
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;And if what you meant was just about SAS datasets then no need for FILE or INFILE or PUT or INPUT statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data good bad;
  set have;
  if check='X' then output bad;
  else output good;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 15 Jun 2024 16:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932542#M366853</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-15T16:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932557#M366857</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466641"&gt;@BeerSultan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I do have it coming via JCL and it's named accordingly. I ended up abandoning using the FILENAME approach altogether...I don't know how to make it work that way.&lt;BR /&gt;&lt;BR /&gt;BYPASS DD DSN=XY.#xyz1234.TEST.DATA.BYPASS,&lt;BR /&gt;DISP=(NEW,CATLG,DELETE),UNIT=TST1,&lt;BR /&gt;DATACLAS=FXB080CP,LRECL=40,&lt;BR /&gt;SPACE=(40,(1,1),RLSE),AVGREC=K&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;When you define the access with a DD statement then in the FILE statement you just use the DDNAME you used in the DD statement.&amp;nbsp; Which in your example DD statement is BYPASS.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;file bypass ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you wanted to mimic the DD statement in a SAS filename statement instead then it would look very similar to the DD statement, but it would look like SAS code instead of JCL code.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check the syntax of the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/hosto390/n06xm17q99z0x6n1tskpswfrgp27.htm" target="_self"&gt;filename statement on z/OS&lt;/A&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename bypass disk 'XY.#xyz1234.TEST.DATA.BYPASS'&amp;nbsp;DISP=(NEW,CATLG,DELETE) .....&amp;nbsp;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jun 2024 23:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932557#M366857</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-15T23:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932578#M366864</link>
      <description>&lt;P&gt;I've got it mostly working, but now the record is in both files...&amp;nbsp; I want the record to go to only the bypass file when it's found, otherwise only go to the other file (which is just the incoming file)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;  IF COMPONENT_STATUS = 'I' THEN DO;
    FILE LTABYPSS;
    PUT
      @ 00001 RECORD_NUMBER       $CHAR8.
    ;
    END;
    ELSE DO;
    FILE DATAIN
    PUT
        @ 00001  lots of values
...
        ;
  END;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 19:35:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932578#M366864</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-16T19:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932579#M366865</link>
      <description>&lt;P&gt;As already said, you need a single FILE statement with a FILEVAR option, and change the contents of that variable. Or you run two separate DATA steps, one for each output file.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 21:45:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932579#M366865</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-16T21:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932580#M366866</link>
      <description>&lt;P&gt;It's part of an existing process that I'm expanding to exclude this bypass file - which is why I was attempting to use the existing reading infile processing and just shunt off the "found" records that I want to exclude.&amp;nbsp; The bypass file will be used in a next step to build a report with counts/rationale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't want to mess with the existing processing too much because it'll cause a larger change than what I'm comfortable doing.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 22:23:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932580#M366866</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-16T22:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932581#M366867</link>
      <description>&lt;P&gt;I have given you the possible solutions, it's your choice which to pursue.&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jun 2024 22:32:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932581#M366867</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-16T22:32:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932586#M366869</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/466641"&gt;@BeerSultan&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;It's part of an existing process that I'm expanding to exclude this bypass file - which is why I was attempting to use the existing reading infile processing and just shunt off the "found" records that I want to exclude.&amp;nbsp; The bypass file will be used in a next step to build a report with counts/rationale.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't want to mess with the existing processing too much because it'll cause a larger change than what I'm comfortable doing.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have not provided enough information to give you complete solution, only suggestions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So if you have an existing program that reads lines from a text file (either to make a dataset or make another file, I cannot tell which from your descriptions and the snippets of programs you have shared) that you now have to change it to also have it copy some of the lines from the source text files to a new text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So you need to change it in the following ways.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Come up with logic that detects which lines it is that you want to write to the file.&lt;/P&gt;
&lt;P&gt;2) Conditionally execute the FILE and PUT statement to write the line to the new file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I showed this before, so let's try again.&amp;nbsp; Let's assume you have some normal program that read a text file into dataset.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input ..... ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So first you have to add the logic to detect the lines you want to skip.&amp;nbsp; This could be a simple as jut reading some part of the line that indicates what type of line it is.&amp;nbsp; So perhaps you want reject the lines that have X in column 32.&lt;/P&gt;
&lt;P&gt;Then you can add code that will write those lines to the new file and not include them in the normal output of the data step.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile myfile ;
  input @32 check $1. @1 @ ;
  if check='X' then do;
    file newfile;
    put _infile_;
    delete;
  end;
  input ..... ;
  drop check;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 01:51:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932586#M366869</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-17T01:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932588#M366870</link>
      <description>&lt;P&gt;You are still missing the semicolon on the FILE statement. (and your indentation is still very confused).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Assuming you fixed the FILE statement that code would NOT write to both of those text files.&amp;nbsp; At least not the little snippet.&amp;nbsp; But since you did not DELETE the observation that you wrote to the BYPASS file than that observation would make it into the DATASET that the step is creating.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why are you writing to a file you are pointing to with a FILEREF (or DDNAME) of DATAIN?&amp;nbsp; Normally that would be the file you want to READ from.&amp;nbsp; Is there some later process that will read from that file?&amp;nbsp; Is that part of this SAS code? Or some other JCL step in your JOB?&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 02:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932588#M366870</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-17T02:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932590#M366872</link>
      <description>&lt;P&gt;Long-story short...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm modifying an existing report that takes hundreds of thousands of insurance policies and calculates financial reserves.&amp;nbsp; A change to a very small subset of policies now has some benefits becoming inactive - so we want to exclude them.&amp;nbsp; However, this indicator data field is only available up to this current point in the job I'm modifying, as it's output file does not contain this status code.&amp;nbsp; The next job step is the summary part, where it would be easy to count up this bypassed-due-to-inactive-status policies.&amp;nbsp; Logically the simplest solution would be to expand the output to include this field so we can just count in the next step - but it is a widely used data structure, and so would involve making changes to a couple dozen other jobs if expanded.&amp;nbsp; We don't have the bandwidth to tackle that kind of work at the moment, but we want to get these policies off the books as we're setting aside not-insignificant amounts of money that could instead be reinvested.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The goal of my process is to find the policies that don't need to have their reserves calculated, pull them out of the mainline processing (the incoming read file) and ship it to a second file.&amp;nbsp; This second file will be sent to the next job step and I'll just count the rows and slap it into the summation section for # of policies skipped due to inactive benefit component.&amp;nbsp; Fulfilling the requirement of the business now, versus in months, and not significantly impacting anything outside of this specific need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The code I provided has the record on both files coming out of this job.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 03:30:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932590#M366872</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-17T03:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932594#M366874</link>
      <description>&lt;P&gt;While writing to multiple files in one DATA step is possible, because of the need for physical filenames it can be tricky on z/OS.&lt;/P&gt;
&lt;P&gt;Instead I would write the data to two WORK datasets (the OUTPUT statement can be given a destination name to write to, which is not possible with PUT), and then run a DATA step for each to create the files.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 06:58:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932594#M366874</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2024-06-17T06:58:16Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932617#M366881</link>
      <description>&lt;P&gt;I still don't see why this is such a problem.&amp;nbsp; But you still have not explained the process with enough detail for us to help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you reading in TEXT files (I know that old time IBM mainframes like to call plain old file "data sets" but they have nothing to do with an actual SAS dataset. They are just file.) in this step that does have the information you need?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the current OUTPUT of that step?&amp;nbsp; Is it another TEXT file?&amp;nbsp; Or is it a SAS dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is a TEXT file then just skip the code that writes the observation to the text file (however many lines it writes) and they will "disappear" from the file consumed by the downstream systems.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is SAS dataset then just skip writing to the that dataset.&amp;nbsp; Does the current step have any OUTPUT statements?&amp;nbsp; If so then skip if for those cases. If not then you need to either add an OUTPUT statement for the observations you to make it to the next step or add a DELETE statement for the ones you don't want to make it to the next step.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 13:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932617#M366881</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-06-17T13:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Creating a file of bypassed records from reading an input file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932630#M366888</link>
      <description>&lt;P&gt;I also don't know why it's such a problem, which is why I'm asking for help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I feel I explained enough that it should be evident what the underlying ask is - like you said this shouldn't be a problem.&amp;nbsp;But, here's a recap; 2 (text)files - the second has no bearing on the ultimate process - come in from the mainframe, it changes a few fields based on criteria, and it outputs a single merged (text)file.&amp;nbsp; This merged output file does &lt;STRONG&gt;not&lt;/STRONG&gt; contain the field necessary in the next step to count/summarize in the next step.&amp;nbsp; I cannot expand the output file to accommodate at this time because it has extensive impacts across dozens of other jobs which would need to be changed and tested and validated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the input file with the status code to count the to write a bypass record in the new bypass (text)file when the status code is inactive.&amp;nbsp; I want the record to &lt;STRONG&gt;not&lt;/STRONG&gt; be on the existing output file because the values in that file are used to calculate reserve cash, and an inactive policy does not need to reserve because the benefit is gone.&amp;nbsp; I'll count the records in the bypass file in the next step and add it to the summary page.&amp;nbsp; That's it.&lt;/P&gt;</description>
      <pubDate>Mon, 17 Jun 2024 14:19:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Creating-a-file-of-bypassed-records-from-reading-an-input-file/m-p/932630#M366888</guid>
      <dc:creator>BeerSultan</dc:creator>
      <dc:date>2024-06-17T14:19:48Z</dc:date>
    </item>
  </channel>
</rss>

