| Date: | Mon, 19 May 2003 10:07:41 -0400 |
| Reply-To: | "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Richard A. DeVenezia" <radevenz@IX.NETCOM.COM> |
| Subject: | Re: copying using scl or base? |
|---|
<Graeme.Kirton@FILCS.COM> wrote in message
news:OFBD87B814.0B7B3D09-ON80256D2B.00437E02-80256D2B.00444589@filcs.com...
> Well I kind of have it working, another problem I have.
>
> WORKS:
>
> graph = 'work.maplong.NONE_289.grseg';
> destcat = 'work.copy';
> entname = scan (graph,3,'.') || '.grseg';
> rc = copy (graph, destcat||'.foobar', 'catalog');
> put rc=;
> rc = rename (destcat||'.'||entname, 'g1', 'catalog');
> put rc=;
>
> DOESN'T WORK, only I'd like it too:
>
> graph=compress(spcchart.graph);
> graph=compress("'"||graph||"'");
>
> /*graph= 'work.maplong.NONE_289.grseg'*/
> destcat = 'work.copy';
> entname = scan (graph,3,'.') || '.grseg';
> rc = copy (graph, destcat||'.foobar', 'catalog');
> put rc=; /*rc=115 which is wrong*/
> rc = rename (destcat||'.'||entname, 'g1', 'catalog');
> put rc=;
> Ta.
>
> --------------------------------------------------------------
> Graeme Kirton
> IT Developer
> Filtronic Compound Semiconductors Ltd
I think you've taken the example too 'literally' :)
I'm not sure why you are quoting the spcchart.graph value. (Or compressing
it for that matter)
graph has the value (quotes included! you put them there!)
'work.maplong.NONE_289.grseg'
when it should be only
work.maplong.NONE_289.grseg
try
source_entry_4 = spcchart.graph; * four level entry name;
destination_entry_3 = 'work.copy.g1'; * three level entry name, fourth level
would be entry type which can not be changed;
rc = copy
( source_entry_4
, destination_entry_3
, 'catalog'
);
* if the bug http://support.sas.com/techsup/unotes/V6/4/4441.html gets
fixed, the following rename will be unnecessary;
source_entry = scan (source_entry4,3,'.'); * third level;
destination_catalog = scan (destination_entry_3,1,'.')||'.'||scan
(destination_entry_3,2,'.');;
destination_entry = scan (destination_entry_3,3,'.');
rc = rename
( destination_catalog || '.' || source_entry
, destination_entry
, 'catalog');
If you amass a 'critical' number of repeated inline coding patterns, you
should consider creating a utility scl entry or object in which you
implement reusable methods that you call or invoke.
--
Richard A. DeVenezia, http://www.devenezia.com
|