<?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 How do I create a text file that doesn't import with &amp;quot;Lost Card&amp;quot; warning? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359710#M84601</link>
    <description>&lt;P&gt;I wrote code that reads in fixed-width text files then looks for specific lines and writes them to a dataset. &amp;nbsp;Then I export lines from that dataset into a new text file that combines all of the lines I was looking for into one file. &amp;nbsp;My goal was to keep the lines exactly as they were in the text files from which they originate such that the import code will import the new text file exactly as it would the original files. &amp;nbsp;When I try to import the text file I get a "Lost Card" note (see log text below). &amp;nbsp;Also it only imports half of the records. There should be 1445 imported and it only imports 722. &amp;nbsp;Otherwise the lines import correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I'm not exporting the file correctly. &amp;nbsp;I used some code from a similar project I worked on to create a csv file and that seemed to work great. &amp;nbsp;I tried changing the "mod=" option to different numbers without success. &amp;nbsp;I looked at other "Lost Card" posts and there have been suggestions such as using truncover on the import. However, because this file is going to passed to someone else and imported into a non-SAS system, I need the new text file to be exactly like the original text files. &amp;nbsp;The purpose of importing the new text file into SAS is only a test to see if it the formats are the same. &amp;nbsp;'The import code works fine for the originals leading me to think there are differences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) &amp;nbsp;Am I not exporting my file correctly?&lt;/P&gt;
&lt;P&gt;2) &amp;nbsp;Is there a way to edit text files without importing them into SAS and storing them in a SAS dataset? &amp;nbsp;Even though I tried to minimize the possibility of unforeseen changes, it seems the act of importing and storing the lines in SAS modifies them to some extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ryan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;52015 /* Import TRX file*/&lt;BR /&gt;52016 %let filename_1=temp.TRX;&lt;BR /&gt;52017 %import_TRX_TRP(C:\Users\Public\&amp;amp;filename_1,test);&lt;/P&gt;
&lt;P&gt;NOTE: The infile IMPORT is:&lt;BR /&gt; Filename=C:\Users\Public\temp.TRX,&lt;BR /&gt; RECFM=V,LRECL=32767,File Size (bytes)=566440,&lt;BR /&gt; Last Modified=17May2017:15:42:55,&lt;BR /&gt; Create Time=17May2017:15:24:42&lt;/P&gt;
&lt;P&gt;NOTE: LOST CARD.&lt;BR /&gt;t_death_year=2017 ...&amp;lt;DELETED SENSITIVE INFORMATION HERE&amp;gt;&amp;nbsp;priority=. _ERROR_=1 _N_=723&lt;BR /&gt;NOTE: 1445 records were read from the infile IMPORT.&lt;BR /&gt; The minimum record length was 390.&lt;BR /&gt; The maximum record length was 390.&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.TEST has 722 observations and 108 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.02 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*****************************************************************************************************
Collect all records that need to be imported
*****************************************************************************************************/
proc sql noprint;  /* Create macro variables holding directories, filenames, and extensions of all trp and trx files */
	select distinct(final_path)
		into :path separated by '@'
		from CCDF_TRX_TRP
		where final_path ne '';
quit;
%let path_obs=&amp;amp;sqlobs;
%put &amp;amp;path_obs &amp;amp;path;

%macro catch_up();
	%do i = 1 %to &amp;amp;path_obs;  /* iterate through the list of full_paths */

		%let path_itr= %scan(&amp;amp;path, &amp;amp;i, '@');  /* scans through the list of files */

		proc sql noprint;  /* Create list of SFNs needed for each of the files */
		   select distinct catt("'", SFN_1, "'")
		      into :SFN_list separated by ' '
		      from CCDF_TRX_TRP
			  where final_path eq "&amp;amp;path_itr";
		quit;

		data comprehensive_temp; 
			missing;

		  	infile "&amp;amp;path_itr" lrecl=2000 truncover;

			length lines $2000; 
		  	input lines $1-2000; 
			keep lines ; 

			if '305'||substr(lines,1,4)||substr(lines,7,6) in (&amp;amp;SFN_list);
		run;

		data comprehensive;
			%if &amp;amp;i = 1 %then %do; set comprehensive_temp; %end;
			%else %do; set comprehensive comprehensive_temp; %end;
			if lines ne '';
		run;
	%end;
%mend catch_up;
%catch_up();


/*****************************************************************************************************
Export cath_up file to I drive
*****************************************************************************************************/
Options noQuoteLenMax;  /* Supresses the warning "WARNING: The quoted string currently being processed has become more than 262 characters long" */
data _null_;
	set comprehensive;
	file "C:\Users\Public\temp.TRX" lrecl=2000 n=/*4*/1 MOD;  * Export file to temporary location;
	put lines;
run;

/* Import TRX file*/
%let filename_1=temp.TRX;
%import_TRX_TRP(C:\Users\Public\&amp;amp;filename_1,test);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 18 May 2017 16:30:00 GMT</pubDate>
    <dc:creator>Ryanb2</dc:creator>
    <dc:date>2017-05-18T16:30:00Z</dc:date>
    <item>
      <title>How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359710#M84601</link>
      <description>&lt;P&gt;I wrote code that reads in fixed-width text files then looks for specific lines and writes them to a dataset. &amp;nbsp;Then I export lines from that dataset into a new text file that combines all of the lines I was looking for into one file. &amp;nbsp;My goal was to keep the lines exactly as they were in the text files from which they originate such that the import code will import the new text file exactly as it would the original files. &amp;nbsp;When I try to import the text file I get a "Lost Card" note (see log text below). &amp;nbsp;Also it only imports half of the records. There should be 1445 imported and it only imports 722. &amp;nbsp;Otherwise the lines import correctly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I'm not exporting the file correctly. &amp;nbsp;I used some code from a similar project I worked on to create a csv file and that seemed to work great. &amp;nbsp;I tried changing the "mod=" option to different numbers without success. &amp;nbsp;I looked at other "Lost Card" posts and there have been suggestions such as using truncover on the import. However, because this file is going to passed to someone else and imported into a non-SAS system, I need the new text file to be exactly like the original text files. &amp;nbsp;The purpose of importing the new text file into SAS is only a test to see if it the formats are the same. &amp;nbsp;'The import code works fine for the originals leading me to think there are differences.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) &amp;nbsp;Am I not exporting my file correctly?&lt;/P&gt;
&lt;P&gt;2) &amp;nbsp;Is there a way to edit text files without importing them into SAS and storing them in a SAS dataset? &amp;nbsp;Even though I tried to minimize the possibility of unforeseen changes, it seems the act of importing and storing the lines in SAS modifies them to some extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Ryan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;52015 /* Import TRX file*/&lt;BR /&gt;52016 %let filename_1=temp.TRX;&lt;BR /&gt;52017 %import_TRX_TRP(C:\Users\Public\&amp;amp;filename_1,test);&lt;/P&gt;
&lt;P&gt;NOTE: The infile IMPORT is:&lt;BR /&gt; Filename=C:\Users\Public\temp.TRX,&lt;BR /&gt; RECFM=V,LRECL=32767,File Size (bytes)=566440,&lt;BR /&gt; Last Modified=17May2017:15:42:55,&lt;BR /&gt; Create Time=17May2017:15:24:42&lt;/P&gt;
&lt;P&gt;NOTE: LOST CARD.&lt;BR /&gt;t_death_year=2017 ...&amp;lt;DELETED SENSITIVE INFORMATION HERE&amp;gt;&amp;nbsp;priority=. _ERROR_=1 _N_=723&lt;BR /&gt;NOTE: 1445 records were read from the infile IMPORT.&lt;BR /&gt; The minimum record length was 390.&lt;BR /&gt; The maximum record length was 390.&lt;BR /&gt;NOTE: SAS went to a new line when INPUT statement reached past the end of a line.&lt;BR /&gt;NOTE: The data set WORK.TEST has 722 observations and 108 variables.&lt;BR /&gt;NOTE: DATA statement used (Total process time):&lt;BR /&gt; real time 0.02 seconds&lt;BR /&gt; cpu time 0.01 seconds&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*****************************************************************************************************
Collect all records that need to be imported
*****************************************************************************************************/
proc sql noprint;  /* Create macro variables holding directories, filenames, and extensions of all trp and trx files */
	select distinct(final_path)
		into :path separated by '@'
		from CCDF_TRX_TRP
		where final_path ne '';
quit;
%let path_obs=&amp;amp;sqlobs;
%put &amp;amp;path_obs &amp;amp;path;

%macro catch_up();
	%do i = 1 %to &amp;amp;path_obs;  /* iterate through the list of full_paths */

		%let path_itr= %scan(&amp;amp;path, &amp;amp;i, '@');  /* scans through the list of files */

		proc sql noprint;  /* Create list of SFNs needed for each of the files */
		   select distinct catt("'", SFN_1, "'")
		      into :SFN_list separated by ' '
		      from CCDF_TRX_TRP
			  where final_path eq "&amp;amp;path_itr";
		quit;

		data comprehensive_temp; 
			missing;

		  	infile "&amp;amp;path_itr" lrecl=2000 truncover;

			length lines $2000; 
		  	input lines $1-2000; 
			keep lines ; 

			if '305'||substr(lines,1,4)||substr(lines,7,6) in (&amp;amp;SFN_list);
		run;

		data comprehensive;
			%if &amp;amp;i = 1 %then %do; set comprehensive_temp; %end;
			%else %do; set comprehensive comprehensive_temp; %end;
			if lines ne '';
		run;
	%end;
%mend catch_up;
%catch_up();


/*****************************************************************************************************
Export cath_up file to I drive
*****************************************************************************************************/
Options noQuoteLenMax;  /* Supresses the warning "WARNING: The quoted string currently being processed has become more than 262 characters long" */
data _null_;
	set comprehensive;
	file "C:\Users\Public\temp.TRX" lrecl=2000 n=/*4*/1 MOD;  * Export file to temporary location;
	put lines;
run;

/* Import TRX file*/
%let filename_1=temp.TRX;
%import_TRX_TRP(C:\Users\Public\&amp;amp;filename_1,test);

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 16:30:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359710#M84601</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T16:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359715#M84602</link>
      <description>&lt;P&gt;When you use this:&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;input&lt;/SPAN&gt; lines &lt;SPAN class="token punctuation"&gt;$&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;-2000&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;It forces SAS to attempt to read 2000 columns but your diagnostics show that the longest record is 390 (in one example) and tries to read the next bit.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's one way:&lt;/P&gt;
&lt;PRE&gt;data want;
   infile "yourfile" lrecl=2000;
   length lines $ 2000;
   input ;
   lines=_infile_;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;_infile_ is an automatic variable containing the entire line of the file when Input executes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) &amp;nbsp;Is there a way to edit text files without importing them into SAS and storing them in a SAS dataset? &amp;nbsp;Even though I tried to minimize the possibility of unforeseen changes, it seems the act of importing and storing the lines in SAS modifies them to some extent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It depends on what you mean by "edit". You can actually have a FILE statement for an output file&amp;nbsp;in the same data step and use PUT to write there. The reads from one file, puts to another without creating a data set.&lt;/P&gt;
&lt;PRE&gt;data _null_;
   infile "yourfile" lrecl=2000;
   File "your output file" ;
   length lines $ 2000;
   input ;
   lines=_infile_;
   put lines;
run;&lt;/PRE&gt;
&lt;P&gt;Put can be conditional so you could use a line like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token keyword"&gt;if&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'305'&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;substr&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;lines&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;1&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;4&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;||&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;substr&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;lines&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;7&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;,&lt;/SPAN&gt;&lt;SPAN class="token number"&gt;6&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;)&lt;/SPAN&gt; &lt;SPAN class="token operator"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token punctuation"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;&amp;amp;&lt;/SPAN&gt;SFN_list&lt;SPAN class="token punctuation"&gt;) then Put lines;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 16:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359715#M84602</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-18T16:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359717#M84603</link>
      <description>&lt;P&gt;Brilliant! &amp;nbsp;Works perfectly. &amp;nbsp;Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 16:57:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359717#M84603</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T16:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359752#M84608</link>
      <description>&lt;P&gt;Thanks for the reply&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A id="link_13" class="lia-link-navigation lia-page-link lia-user-name-link" href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884" target="_self"&gt;ballardw&lt;/A&gt;. &amp;nbsp;I thought it worked because I didn't get the lost card error and I had the correct number of records; however, I realized that when I ran the export code the second time it stacked the lines on top of the previous output duplicating the records that were already there. &amp;nbsp;What's interesting is the end result of importing this duplicated file is the dataset I was looking to import (i.e., all records with no dupes). &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="login-bold"&gt;When I delete the text file and run the code again I still ge the "Lost Card" note as well as only half of the records from the text file.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;I also tried your second solution, but I get the same "Lost Card" note, and the file resulting from the put statement does not include all 1445 records (Strangely it includes 1397 records).&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="login-bold"&gt;Any other thoughts?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 17:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359752#M84608</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T17:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359755#M84610</link>
      <description>&lt;P&gt;The code for the second solution results in 1397 records instead of 1445 because it's only outputing records from one input file. &amp;nbsp;Effectively overwriting the first input file with the second rather than stacking them on top of each other.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 18:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359755#M84610</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T18:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359768#M84612</link>
      <description>&lt;P&gt;It looks like the line from the original text file is 407 characters long because there are 17 spaces(?) added to the end. &amp;nbsp;The spaces are removed in the new text file. &amp;nbsp;I tried adding spaces back several different ways but no matter what I try the spaces are stripped at the end of the line in the new text file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems like the import code does not recognize the end of the line and that's why it's only importing every other line. &amp;nbsp;I tried to add carriage returns and line feeds but they seem to be stripped as well. If I add another put statement to create a blank line, the file imports correctly, but that's not the format of the original file.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does anyone know how to retain the spaces or add spaces and/or line feeds and carriage returns.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 19:12:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359768#M84612</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T19:12:25Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359793#M84620</link>
      <description>&lt;P&gt;I made some modifications based on the code ballardw provided and by adding the spaces to the end of the put statement made the import work successfully. &amp;nbsp;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET run_started = %SYSFUNC( DATETIME(), DATETIME ) ;      /* Assigns date and time to macro variable run_started  */
%LET run_started = %SYSFUNC(tranwrd(&amp;amp;run_started,:,-) ) ;  /* replaces colon with dash so that it can be included in filenames */

proc sql noprint;  /* Create macro variables holding directories, filenames, and extensions of all trp and trx files */
	select distinct(final_path)
		into :path separated by '@'
		from CCDF_TRX_TRP
		where final_path ne '';
quit;
%let path_obs=&amp;amp;sqlobs;
%put &amp;amp;path_obs &amp;amp;path;

%macro catch_up();
	%do i = 1 %to &amp;amp;path_obs;  /* iterate through the list of full_paths */

		%let path_itr= %scan(&amp;amp;path, &amp;amp;i, '@');  /* scans through the list of files */

		proc sql noprint;  /* Create list of SFNs needed for each of the files */
		   select distinct catt("'", SFN_1, "'")
		      into :SFN_list separated by ' '
		      from CCDF_TRX_TRP
			  where final_path eq "&amp;amp;path_itr";
		quit;

		data _null_; 
			missing;

		  	infile "&amp;amp;path_itr" lrecl=407 truncover;
			File "C:\Users\Public\catch_up_file_&amp;amp;run_started..TRX" mod; /* mod tells SAS to stack new records rather than write-over */

			length lines $407; 
		  	input lines $1-407;

			if '305'||substr(lines,1,4)||substr(lines,7,6) in (&amp;amp;SFN_list) then put lines '                ';  /* Add back truncated spaces at end of line - needed for import */
		run;
	%end;
%mend catch_up;
%catch_up();&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 18 May 2017 19:56:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359793#M84620</guid>
      <dc:creator>Ryanb2</dc:creator>
      <dc:date>2017-05-18T19:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: How do I create a text file that doesn't import with "Lost Card" warning?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359818#M84636</link>
      <description>&lt;P&gt;If the issue is writing a fixed lenght padded with blanks use the proper options:&lt;/P&gt;
&lt;PRE&gt;data _null_;
  file "yourfilename.txt" lrecl=80 pad;
  x= "Short text";
  put x;
run;&lt;/PRE&gt;
&lt;P&gt;the output file will have blanks to a length of 80.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46197"&gt;@Ryanb2&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It seems like the import code does not recognize the end of the line and that's why it's only importing every other line.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;IF you use a specified format on an input that exceeds the length of the actual input line then you read past the end of line in effect eating the following line. There are many interactions between how you specify what to read and the file options such as PAD TRUNCOVER MISSOVER FLOWOVER&amp;nbsp;RECFMT DELIMITER TERMSTR LRECL. Without example input data and the exact desired output it can be a bit hard to catch all of the needed options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/20809"&gt;@And&lt;/a&gt; with Put you get to consider use of column/line pointers (@n or&amp;nbsp;#n), trailing @ or @@;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may need to describe more about what you mean by add "line feeds or carriage controls". Which operating system you operate under comes into consideration.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A bare Put; will right a newline to the output destination in the form of the current operating system. If you need a character that is NOT your current OS line ender then you can use the BYTE function to assign the value of any chacter to a varaible and put that character but likely getting into more than you actually need.&lt;/P&gt;</description>
      <pubDate>Thu, 18 May 2017 20:34:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-create-a-text-file-that-doesn-t-import-with-quot-Lost/m-p/359818#M84636</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-18T20:34:17Z</dc:date>
    </item>
  </channel>
</rss>

