[Download-List] Header record/date format

David L. Rotman rotmand at cedarville.edu
Tue Feb 24 13:26:34 EST 2004


The design dilemma is that DOWNLOAD has no way to know how
much space to reserve for the EVAL expression when using FIXED
format.

Here are two ways to get the job done:

SELECT PERSON SAMPLE 5
DOWNLOAD PERSON \
FILE HOLD XWDS.TEST FORMAT FIXED OVERWRITING \
HEADING \
LITERAL "ABC" \
EVAL "OCONV(@DATE,'D4/')" FMT "10L" \
LITERAL "DEF" \
DETAIL PERSON.NAME

SELECT PERSON SAMPLE 5
DOWNLOAD PERSON \
FILE HOLD XWDS.TEST FORMAT FIXED OVERWRITING \
HEADING \
EVAL "'ABC':OCONV(@DATE,'D4/'):'DEF'" \
DETAIL PERSON.NAME

In the second method, the ABC and DEF are enclosed in
single quotes (the entire EVAL expression is enclosed in
double quotes).




Dave Rotman
Director of Computer Services
Cedarville University
251 N. Main Street
Cedarville, OH 45314
rotmand at cedarville.edu
voice 937-766-7905
fax 937-766-8819

>>> Wendy.Smoak at asu.edu 2/24/2004 12:41:20 PM >>>
Shawn Waldie wrote:
> I'm not sure how, but I would like to include @DATE, with a
YYYY-MM-DD
> format, in the header record of what will be a fixed-length 
> file.

Something like this might work:
:SELECT PERSON SAMPLE 5
> DOWNLOAD PERSON FILE HOLD XWDS.TEST FORMAT FIXED OVERWRITING HEADING
LITERAL 
"ABC" EVAL "OCONV(@DATE,'D4/')" LITERAL "DEF" DETAIL PERSON.NAME

Actually that produced this:
Top of "XWDS.TEST" in "HOLD", 6 lines, 168 characters.

001: ABCDEF24/2004      

But I expected ABC02/24/2004DEF.  It's as though the EVAL didn't "take
up" any space, and the second literal overwrote the first three
characters of the EVAL.  This may require Dave's intervention... (and
I'm on an old version still, so it may be fixed in the latest one.)

You can use a different format with OCONV to get the YYYY-MM-DD format
that you need.

Can someone with DOWNLOAD 7.1 try my example and let me know if it
works?

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 


_______________________________________________
download-list mailing list
download-list at cedarville.edu 
http://mail.cedarville.edu/mailman/listinfo/download-list



More information about the download-list mailing list