<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: CL pgm required to copy data</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/</link>
	<description></description>
	<lastBuildDate>Wed, 19 Jun 2013 04:33:39 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: kf</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63469</link>
		<dc:creator>kf</dc:creator>
		<pubDate>Tue, 12 May 2009 14:37:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-63469</guid>
		<description><![CDATA[Hi,

Many thanks for your help. I&#039;ll set this up in our test system.

Regards
Keith]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Many thanks for your help. I&#8217;ll set this up in our test system.</p>
<p>Regards<br />
Keith</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63454</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Tue, 12 May 2009 13:15:03 +0000</pubDate>
		<guid isPermaLink="false">#comment-63454</guid>
		<description><![CDATA[Hi,

You can use RTVSYSVAL to retrieve the system date.  Then you can use the date as (part of) the file name.  This is what the CHGVAR command does in my example - it &quot;concatenates&quot; the letter C and the year, month and day to give C090512 for the 12th of May 2009.  Of course you would need to do this on the same day as your file is created.

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You can use RTVSYSVAL to retrieve the system date.  Then you can use the date as (part of) the file name.  This is what the CHGVAR command does in my example &#8211; it &#8220;concatenates&#8221; the letter C and the year, month and day to give C090512 for the 12th of May 2009.  Of course you would need to do this on the same day as your file is created.</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kf</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63448</link>
		<dc:creator>kf</dc:creator>
		<pubDate>Tue, 12 May 2009 11:53:30 +0000</pubDate>
		<guid isPermaLink="false">#comment-63448</guid>
		<description><![CDATA[Gilly400,

Thx for input. I know only the basics when it comes to cl.

The 2 files are already created and it is these files that are required to be copied. How do you get the data from the correct file? The format of the file is YYMMDD preceded always by the letter &#039;C&#039;. E.G C090512.
So, after our end of day processing today the system will create the next days file which will be C090513, and populate it with the data needed.
How do you get the correct data from the current file as the previous ones are still held in the library until save/deleted? 

Thx]]></description>
		<content:encoded><![CDATA[<p>Gilly400,</p>
<p>Thx for input. I know only the basics when it comes to cl.</p>
<p>The 2 files are already created and it is these files that are required to be copied. How do you get the data from the correct file? The format of the file is YYMMDD preceded always by the letter &#8216;C&#8217;. E.G C090512.<br />
So, after our end of day processing today the system will create the next days file which will be C090513, and populate it with the data needed.<br />
How do you get the correct data from the current file as the previous ones are still held in the library until save/deleted? </p>
<p>Thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63447</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Tue, 12 May 2009 11:05:39 +0000</pubDate>
		<guid isPermaLink="false">#comment-63447</guid>
		<description><![CDATA[Hi,

You could try the following - this gets the date from the system values and uses that to build the file name - it assumes that all the files are in library YOURLIB.  It creates a file called ARCHIVE with a record length of 132 which you can then download - maybe you&#039;ll need to increase the record length, depending on your input files.  You may need some extra MONMSG&#039;s for the CPYF statements. :-

PGM

DCL &amp;FILENAME *CHAR 10
DCL &amp;DD *CHAR 2
DCL &amp;MM *CHAR 2
DCL &amp;YY *CHAR 2

RTVSYSVAL QDAY &amp;DD
RTVSYSVAL QMONTH &amp;MM
RTVSYSVAL QYEAR &amp;YY

CHGVAR &amp;FILENAME (&#039;C&#039; &#124;&#124; &amp;YY &#124;&#124; &amp;MM &#124;&#124; &amp;DD)

CRTPF FILE(YOURLIB/ARCHIVE) RCDLEN(132)
MONMSG CPF7302

CPYF FROMFILE(YOURLIB/DOWNLOAD) TOFILE(YOURLIB/ARCHIVE) MBROPT(*REPLACE)
CPYF FROMFILE(YOURLIB/&amp;FILENAME) TOFILE(YOURLIB/ARCHIVE) MBROPT(*ADD)

ENDPGM

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You could try the following &#8211; this gets the date from the system values and uses that to build the file name &#8211; it assumes that all the files are in library YOURLIB.  It creates a file called ARCHIVE with a record length of 132 which you can then download &#8211; maybe you&#8217;ll need to increase the record length, depending on your input files.  You may need some extra MONMSG&#8217;s for the CPYF statements. :-</p>
<p>PGM</p>
<p>DCL &amp;FILENAME *CHAR 10<br />
DCL &amp;DD *CHAR 2<br />
DCL &amp;MM *CHAR 2<br />
DCL &amp;YY *CHAR 2</p>
<p>RTVSYSVAL QDAY &amp;DD<br />
RTVSYSVAL QMONTH &amp;MM<br />
RTVSYSVAL QYEAR &amp;YY</p>
<p>CHGVAR &amp;FILENAME (&#8216;C&#8217; || &amp;YY || &amp;MM || &amp;DD)</p>
<p>CRTPF FILE(YOURLIB/ARCHIVE) RCDLEN(132)<br />
MONMSG CPF7302</p>
<p>CPYF FROMFILE(YOURLIB/DOWNLOAD) TOFILE(YOURLIB/ARCHIVE) MBROPT(*REPLACE)<br />
CPYF FROMFILE(YOURLIB/&amp;FILENAME) TOFILE(YOURLIB/ARCHIVE) MBROPT(*ADD)</p>
<p>ENDPGM</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kf</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63443</link>
		<dc:creator>kf</dc:creator>
		<pubDate>Tue, 12 May 2009 10:05:25 +0000</pubDate>
		<guid isPermaLink="false">#comment-63443</guid>
		<description><![CDATA[Many thx.

The 2 files contain details of reports that are produced on a daily basis, which are to be downloaded into a report archive system for people to view. The first file name is constant but the second changes daily in the format of the date e.g. CYYMMDD

File name examples as follows:

DOWNLOAD
C090512

I need a cl pgm to copy the report data on a daily basis from these 2 files into a new file, that will then be used to download the reports to the archive software.

I don&#039;t know how to include the data from the file name that changes, and whether I need to declare any variables or message monitoring etc.

I would appreciate any help you can give.

Thx]]></description>
		<content:encoded><![CDATA[<p>Many thx.</p>
<p>The 2 files contain details of reports that are produced on a daily basis, which are to be downloaded into a report archive system for people to view. The first file name is constant but the second changes daily in the format of the date e.g. CYYMMDD</p>
<p>File name examples as follows:</p>
<p>DOWNLOAD<br />
C090512</p>
<p>I need a cl pgm to copy the report data on a daily basis from these 2 files into a new file, that will then be used to download the reports to the archive software.</p>
<p>I don&#8217;t know how to include the data from the file name that changes, and whether I need to declare any variables or message monitoring etc.</p>
<p>I would appreciate any help you can give.</p>
<p>Thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gilly400</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/cl-pgm-required-to-copy-data/#comment-63441</link>
		<dc:creator>gilly400</dc:creator>
		<pubDate>Tue, 12 May 2009 09:59:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-63441</guid>
		<description><![CDATA[Hi,

You could do something like the following :-

PGM PARM(&amp;FILE &amp;LIB)

DCL &amp;FILE *CHAR 10
DCL &amp;LIB *CHAR 10

CPYF FROMFIL(LIB1/FILE1) TOFILE(LIB1/NEWFILE) MBROPT(*REPLACE)

CPYF FROMFILE(&amp;LIB/&amp;FILE) TOFILE(LIB1/NEWFILE) MBROPT(*ADD)

ENDPGM

Where LIB1/FILE1 is the (from)file which is always the same name and LIB1/NEWFILE is the file you have to copy to.  &amp;FILE is the variable file name and &amp;LIB is the library that contains the variable file name.

You could then call the program :-

CALL PROGRAM PARM(Myfile  Mylib)

To process file Myfile in library Mylib.  If your variable file is always in the same library then you could remove the &amp;LIB coding and replace the library name in the CPYF command - you also wouldn&#039;t need to pass the library on the CALL command.

Regards,

Martin Gilbert.]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>You could do something like the following :-</p>
<p>PGM PARM(&amp;FILE &amp;LIB)</p>
<p>DCL &amp;FILE *CHAR 10<br />
DCL &amp;LIB *CHAR 10</p>
<p>CPYF FROMFIL(LIB1/FILE1) TOFILE(LIB1/NEWFILE) MBROPT(*REPLACE)</p>
<p>CPYF FROMFILE(&amp;LIB/&amp;FILE) TOFILE(LIB1/NEWFILE) MBROPT(*ADD)</p>
<p>ENDPGM</p>
<p>Where LIB1/FILE1 is the (from)file which is always the same name and LIB1/NEWFILE is the file you have to copy to.  &amp;FILE is the variable file name and &amp;LIB is the library that contains the variable file name.</p>
<p>You could then call the program :-</p>
<p>CALL PROGRAM PARM(Myfile  Mylib)</p>
<p>To process file Myfile in library Mylib.  If your variable file is always in the same library then you could remove the &amp;LIB coding and replace the library name in the CPYF command &#8211; you also wouldn&#8217;t need to pass the library on the CALL command.</p>
<p>Regards,</p>
<p>Martin Gilbert.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 6/8 queries in 0.012 seconds using memcached
Object Caching 339/340 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-06-19 06:15:50 -->