• Subject: Re: Substring DDS
  • From: "Peter Dow" <pcdow@xxxxxxxxx>
  • Date: Thu, 23 Mar 2000 16:21:47 -0800

Hi Raul,

Yes, it works. For example:

Physical file DDS (file name FILEA):
     A          R TESTREC                   TEXT('TEST')
     A            DATE1           L         TEXT('DATE')
     A            TIME1           T         TEXT('TIME')
     A            TSTMP           Z         TEXT('TIMESTAMP')

Logical file DDS (file name FILEB):
      A          R TESTREC1                  PFILE(FILEA)
      A            DATE1           A         DATFMT(*YYMD)
      A            TIME1           S         TIMFMT(*HMS)
      A            TSTMP           L  I
      A            DAY                I      SST(DATE1 7 2)
      A          K DAY

A field in a logical file can change the type of the corresponding field in
the physical in certain situations, the date field being one of them. This
ability was actually the subject of a white paper concerning methods of
dealing with Y2K. The idea was to take all existing PF's that contained
numeric fields used as dates, rename them and change the fields to native
date fields (type L), then create logicals with the original physical file's
name and in the logical convert all date fields back to their original
numeric definition. The CPYF command could be used to copy data from the old
physical file to the new one and would actually convert the numeric fields
to date fields as long as they had a valid date in them. Then you could
gradually convert programs to use the native date fields.

Nice idea, but in practice I think too many people had special values or
just plain invalid dates in those fields. At least, I never heard of anyone
actually using this method.

hth
Peter Dow
Dow Software Services, Inc.
909 425-0194 voice
909 425-0196 fax


From: Raul Jager <raul@abc.com.py>
> _____________________________________________________
>
> I know it works if DATA is alpha or zoned.
> Can we do this with part of a date field?  Like day?
> ____________________________________________________________


> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
david@midrange.com
> +---


__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.