|
Brian,
Joe has probably already provided a solution that will solve your current
problem, but you've peaked my curiosity.
Can you post a sample of your shortest layout file?
Art
------
On Mon, 3 Jan 2011 17:45:28 -0500, Brian Trautman <btrautman84@GMAIL.COM>
wrote:
>This SAS job processes certain kinds of layout files DB2 produces and makes
>a SAS layout that can work with the unloaded dataset. However, the DB2
>layout files don't include the length of VARCHAR fields. Most of the time
>this can be derived simply based on wherever the next field starts, but
this
>doesn't work if the VARCHAR field is the last field in the DB2 unload. In
>those cases, the VARCHAR field is best handled as ending wherever the file
does.
>
>I won't be the only one using this SAS job, and most of our users wouldn't
>be used to specifying the lrecl in the macro variable, rather than the
>filename statement. That's why I was hoping to, when a varchar was the
last
>field in an output file, have logic to handle this.
>
>Thank you!
>
>Brian
>
>On Mon, 3 Jan 2011 13:32:47 -0600, Joe Matise <snoopy369@GMAIL.COM> wrote:
>
>>Brian,
>>What's the end goal here? If it's simply to 'do things based on the
>>[provided] LRECL', then %let (or call the macro with the LRECL as a
>>parameter) seems perfectly reasonable. I assume you must have a reason
for
>>not wanting to do it that way - what is it? Do you want to automatically
>>determine the LRECL?
>>
>>Thanks,
>>
>>Joe
>>
>>On Mon, Jan 3, 2011 at 1:13 PM, Brian Trautman
<btrautman84@gmail.com>wrote:
>>
>>> I have the following SAS program --
>>>
>>> filename fs ftp "'SAMPLE.LOC'"
>>> binary host="srvr"
>>> user=user
>>> pass=pass
>>> lrecl=200
>>> debug ;
>>>
>>> DATA FFSheet_01_FPPS_Sort ;
>>>
>>> INFILE fs ;
>>> INPUT
>>> @001 Blob $EBCDIC100.
>>> @ ;
>>>
>>> RUN ;
>>>
>>> I'd like to be able to write a macro that detects the lrecl used in my
>>> filename statement, and does things based on it. I know one way to do
it
>>> would be to simply do something like this --
>>>
>>> %let llen = 200;
>>>
>>> filename fs ftp "'SAMPLE.LOC'"
>>> binary host="srvr"
>>> user=user
>>> pass=pass
>>> lrecl=&llen
>>> debug ;
>>>
>>> However, I'd like to avoid this solution if at all possible. Are there
any
>>> other options?
>>>
|