<?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: trying to read cobol raw dataset and converting into output dataset in CSV format. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360688#M84979</link>
    <description>&lt;P&gt;To copy a screen from Personal communications, just use the mouse to mark the area and do Edit - Copy from the menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I expected, you have a fixed format file, no delimiters.&lt;/P&gt;
&lt;P&gt;A data step to read that file should look like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile (use the fileref from the JCL DSN) lrecl=(value as shown) recfm=f;
input
  x71340d_va_hdr_rec_id   1.
  x71340d_va_hdr_rvsl_flag  $1.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and so on. Note that date and time values are only recognizable by name, so you will have to do the conversion all by yourself; I also see that one date comes in a zoned length 8 field, while the other is in a packed decimal length 4. So you need to inspect the actual contents for that.&lt;/P&gt;
&lt;P&gt;For PD fields, use the s370fpd informat.&lt;/P&gt;
&lt;P&gt;Since you have no reliable means of distiguishing date and time values from other, "normal" numbers, you will have to write most of the data step by hand.&lt;/P&gt;
&lt;P&gt;And I would clearly not use variable names like A0001, A0002 and so on. That's 1960s style coding.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2017 11:44:23 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2017-05-23T11:44:23Z</dc:date>
    <item>
      <title>trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360670#M84970</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a requirement to convert COBOL raw dataset to readable format, to achieve this i am reading a cobol copy book and converting each field type to SAS equivalent field types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now i am inputting the COBOL raw data file to the mainframe JCL(Job) which has SAS parameters in the control card and want my output in CSV format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want my SAS to read the COBOL raw data file and convert it to corresponding field type mentioned and print the output in the file which should be in CSV format.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards,&lt;/P&gt;&lt;P&gt;rakesh MS&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 10:40:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360670#M84970</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-23T10:40:44Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360673#M84972</link>
      <description>&lt;P&gt;Could you please post an example of the copy book, and a screen copy of the "Data Set Information" panel from TSO for the respective COBOL file?&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 10:48:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360673#M84972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-23T10:48:59Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360676#M84973</link>
      <description>&lt;P&gt;Sorry, please post clear examples of data/programs etc associated with the question. &amp;nbsp;I don't have Cobol files lying around to use. &amp;nbsp;From a quick Google copybook is nothing more than a Cobol program? &amp;nbsp;What is the data file format, is it binary or text. &amp;nbsp;If its text then simply a matter of identifying columns/rows an reading in using a datastep. &amp;nbsp;If its binary then this is quite a bit harder.&lt;/P&gt;
&lt;P&gt;Here is a link you may find useful:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/4877379/reading-a-cobol-generated-file" target="_blank"&gt;https://stackoverflow.com/questions/4877379/reading-a-cobol-generated-file&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 10:51:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360676#M84973</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-23T10:51:39Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360686#M84978</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find the scrren shots attached. I have no access to take the screen prints of the Panel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note : Input file (COBOL dataset) is in Fixed block format.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh MS&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13863i949325049B2AA7E5/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3845.JPG" title="IMG_3845.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13864iF23B32BD601285D0/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3846.JPG" title="IMG_3846.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13865iEF33DC694C9B0A3C/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3847.JPG" title="IMG_3847.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13866i85CDDD51B4866BBD/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3848.JPG" title="IMG_3848.JPG" /&gt;</description>
      <pubDate>Tue, 23 May 2017 11:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360686#M84978</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-23T11:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360688#M84979</link>
      <description>&lt;P&gt;To copy a screen from Personal communications, just use the mouse to mark the area and do Edit - Copy from the menu.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As I expected, you have a fixed format file, no delimiters.&lt;/P&gt;
&lt;P&gt;A data step to read that file should look like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
infile (use the fileref from the JCL DSN) lrecl=(value as shown) recfm=f;
input
  x71340d_va_hdr_rec_id   1.
  x71340d_va_hdr_rvsl_flag  $1.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and so on. Note that date and time values are only recognizable by name, so you will have to do the conversion all by yourself; I also see that one date comes in a zoned length 8 field, while the other is in a packed decimal length 4. So you need to inspect the actual contents for that.&lt;/P&gt;
&lt;P&gt;For PD fields, use the s370fpd informat.&lt;/P&gt;
&lt;P&gt;Since you have no reliable means of distiguishing date and time values from other, "normal" numbers, you will have to write most of the data step by hand.&lt;/P&gt;
&lt;P&gt;And I would clearly not use variable names like A0001, A0002 and so on. That's 1960s style coding.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 11:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360688#M84979</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-23T11:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360763#M85008</link>
      <description>Hi kurt,&lt;BR /&gt;&lt;BR /&gt;Thanks for looking into this. Will incorporate all the comments given. Just a concern, where do I mention the output file which I need it in CSV format.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rakesh</description>
      <pubDate>Tue, 23 May 2017 14:36:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360763#M85008</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-23T14:36:49Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360766#M85010</link>
      <description>&lt;P&gt;You will need another dsn in the JCL script that gives you a reference for the output file; use that as a fileref within your SAS program, and when writing from your dataset, add the corresponding options (lrecl= and recfm=) to the file statement in the data _null_ step.&lt;/P&gt;
&lt;P&gt;ie&lt;/P&gt;
&lt;P&gt;In the JCL you have a DSN for OUT&lt;/P&gt;
&lt;P&gt;In SAS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set your_dataset;
file out recfm=vb lrecl=1000 dlm=',' dsd;
put
  /* variables */
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 May 2017 14:46:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360766#M85010</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-23T14:46:21Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360769#M85011</link>
      <description>&lt;P&gt;Unless your file is huge (more than 100 Gigabytes?) I would first read it into a SAS dataset and then generate the CSV file (if needed).&lt;/P&gt;
&lt;P&gt;So first make a data step to read the file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data mydata;
   infile .... ;
   input .... ;
   ....
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;You can use PROC EXPORT to generate a CSV file.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc export data=mydata file='mydata.csv' dbms=dlm ;
  delimiter=',';
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you can very easily write a CSV file directly using a data step, especially if you do not need to include a header row.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  set mydata;
  file 'mydata.csv' dsd ;
  put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the file is really large then you can use the FILE and PUT statement of the last data step as part of the step that reads the COBOL file and skip making even a SAS WORK dataset.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 14:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/360769#M85011</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-23T14:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361019#M85089</link>
      <description>&lt;P&gt;Hi tom,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Ihave two Questions for you&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) i am trying to use data _null_;&lt;BR /&gt;set temp1;&lt;BR /&gt;file 'output file' dlm=',' dsd ;&lt;BR /&gt;put (_all_) (+0);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;How to switch on the labels. I need the labels on the top row and then the values below it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) I tried using&amp;nbsp;&lt;/P&gt;&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;export&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;mydata &lt;SPAN class="token statement"&gt;file&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;'mydata.csv'&lt;/SPAN&gt; dbms&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;dlm &lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
  delimiter&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;&lt;SPAN class="token string"&gt;','&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;proc export data=temp1 file='outputfile' dbms=dlm;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;delimiter=',';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh MS&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It gives me error ; Statement not valid or it is used out of proper order&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Delimiter=','&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;tatement not valid or it is used out of proper order&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 05:57:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361019#M85089</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-24T05:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361034#M85099</link>
      <description>&lt;P&gt;delimiter= is an option of the proc export statement, so you need to remove the semicolon preceding it.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 06:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361034#M85099</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T06:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361037#M85100</link>
      <description>&lt;P&gt;kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do we display the labels &amp;nbsp;? and one more thing, can we dynamically convert the data to readable format with out knowing their data types ?. Actually there are lot of redefine clauses in the mainframe copy book. Field which is getting redefined has a different field type compared to redefined field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can we handle header and trailer of the file separately ??, header and trailer data is been adding prior in every data that is present.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;let me know if you need any more information&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh MS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 07:01:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361037#M85100</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-24T07:01:14Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361039#M85102</link>
      <description>&lt;P&gt;In a "manual" data step, you need to add the header line in the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set temp1;
file 'output file' dlm=',' dsd ;
if _n_ = 1 then put "headertext,in,correct,format,comes,here";
put (_all_) (+0);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 24 May 2017 07:17:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361039#M85102</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T07:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361040#M85103</link>
      <description>&lt;P&gt;What do you mean by "without knowing their data types"? If you don't know your data, how are you supposed to work with it? Read the documentation and work from that. Data without documentation is returned to sender with a corresponding nastygram.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 07:20:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361040#M85103</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T07:20:25Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361085#M85115</link>
      <description>&lt;P&gt;I asked you this question becasue of redefine clause in the COBOL copy book. Copy book fields are internally redefined so that they use the same space to store but when they get redefined they are defined with different data types.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you help me with label syntax. I want a label for every field and data to be under it in the output file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh MS&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 08:39:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361085#M85115</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-24T08:39:05Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361110#M85119</link>
      <description>&lt;P&gt;If you do not have sufficient documentation and there is no way to get it (HIGHLY unlikely as COBOL is typically used in environments where everybody was extremely anal about proper documentation. Think banking, insurance, and the like), then you need to start reading the COBOL sources to get a picture of what the data files really contain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For header lines, see this example using SASHELP.CLASS:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
set sashelp.class;
file '$HOME/sashelp.csv' dlm=',';
if _n_ = 1 then put 'Name,Sex,Age,Height,Weight';
put name sex age height weight;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The resulting file then looks like this:&lt;/P&gt;
&lt;PRE&gt;Name,Sex,Age,Height,Weight
Alfred,M,14,69,112.5
Alice,F,13,56.5,84
Barbara,F,13,65.3,98
Carol,F,14,62.8,102.5
Henry,M,14,63.5,102.5
James,M,12,57.3,83
Jane,F,12,59.8,84.5
Janet,F,15,62.5,112.5
Jeffrey,M,13,62.5,84
John,M,12,59,99.5
Joyce,F,11,51.3,50.5
Judy,F,14,64.3,90
Louise,F,12,56.3,77
Mary,F,15,66.5,112
Philip,M,16,72,150
Robert,M,12,64.8,128
Ronald,M,15,67,133
Thomas,M,11,57.5,85
William,M,15,66.5,112
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 09:12:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361110#M85119</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T09:12:18Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361128#M85125</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this is dynamic flow, i will not be hard coding the label. It has to be read from the copy book and then take the field name as label name. Attached is the screen shot which i initially pasted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;now i want label names attached in the screen shot to be printed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rakesh MS&lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13872i9949F6E5FD509720/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3846.JPG" title="IMG_3846.JPG" /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/13873i0C49883AE618FC78/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="IMG_3848.JPG" title="IMG_3848.JPG" /&gt;</description>
      <pubDate>Wed, 24 May 2017 10:20:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361128#M85125</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-24T10:20:36Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361137#M85130</link>
      <description>&lt;P&gt;Since we have already determined that the main attributes of the SAS variables cannot be reliably determined from the copybook, it does not make sense to just automate the labels. That's such a minor part of all the work that trying to automate it is just a waste of precious brain-cycles.&lt;/P&gt;</description>
      <pubDate>Wed, 24 May 2017 10:59:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361137#M85130</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-24T10:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361256#M85167</link>
      <description>Hi kurt,&lt;BR /&gt;&lt;BR /&gt;I was referring to label like below&lt;BR /&gt;&lt;BR /&gt;Proc print data label noobs;&lt;BR /&gt;&lt;BR /&gt;I want the similar syntax while writing to the output file using put statement.&lt;BR /&gt;Regards,&lt;BR /&gt;Rakesh MS</description>
      <pubDate>Wed, 24 May 2017 15:47:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361256#M85167</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-24T15:47:54Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361505#M85267</link>
      <description>kurt,&lt;BR /&gt;How to display labels in the put statement.&lt;BR /&gt;&lt;BR /&gt;label A20219 "x50978 nvcb trans hand fee ";&lt;BR /&gt;&lt;BR /&gt;data _null_;&lt;BR /&gt;set temp1;&lt;BR /&gt;file sasout dlm="," dsd;&lt;BR /&gt;put (_all_) (+0);&lt;BR /&gt;run;</description>
      <pubDate>Thu, 25 May 2017 08:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361505#M85267</guid>
      <dc:creator>rakesh1212</dc:creator>
      <dc:date>2017-05-25T08:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: trying to read cobol raw dataset and converting into output dataset in CSV format.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361529#M85283</link>
      <description>&lt;P&gt;You have to write the headerline in the datastep in the way I already showed you.&lt;/P&gt;
&lt;P&gt;You can retrieve the labels automatically like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select label into :headerline separated by ','
from dictionary.columns
where upcase(libname) = "LIBRARY" and upcase(memname) = "DATASET";
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The corresponding line of code in the datastep will then be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if _n_ = 1 then put "&amp;amp;headerline";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 25 May 2017 11:03:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/trying-to-read-cobol-raw-dataset-and-converting-into-output/m-p/361529#M85283</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-25T11:03:47Z</dc:date>
    </item>
  </channel>
</rss>

