doedit help

GCC Consulting gcc at optonline.net
Thu Jun 17 09:10:40 PDT 2004


 


________________________________

	From: filepro-list-bounces at lists.celestial.com
[mailto:filepro-list-bounces at lists.celestial.com] On Behalf Of Guy Templin
	Sent: Wednesday, June 16, 2004 3:00 PM
	To: Filepro
	Subject: doedit help
	
	
	Unix and filepro 4.8
	 
	I have a processing table where I am trying to apply an edit to a field
and it is not working as I thought. 
	We have a dealer number which consists of ###-## (three numbers a dash
and 2 numbers) We have an edit dlrnum in the global edits table to handle
entering a number with or with out the dash. If entered without the dash it is
supplied by the edit and is OK.  The problem is now where I am taking input from
an import file and then creating a selection set to then run a report process.
If the number is entered correctly with a dash it runs OK. However if it is
entered with out the dash it seems to fail the edit and then db equals "" and no
value is placed in the selection set. Does anyone have any suggestions? I
included the beginning of the processing the rest is the export file to write
the sel.* table.
	 
	 1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	       │ If:
│
	       Then: in(50,*,g)=getenv("INPUT")
│
	  2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	       │ If:
│
	       Then: fl(50,*,g)=getenv("OUTPUT")
│
	  3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	readit │ If:
│
	       Then: import ascii data=(in) r=\ f=|
│
	  4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	       │ If: not data
│
	       Then: end
│
	  5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	       │ If:
│
	       Then: da(6,#,g)=data(2)
│
	  6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
-
	       │ If:
│
	       Then: db = DOEDIT(da,"dlrnum","6")   
	 
	 
	Guy Templin
	Adelphi Kitchens, Inc.
As other have suggested, change your edit to remove a leading space. You could
also change da from a numeric filed to an alphanumeric field.  This will keep
non dashed numbers left justified and your dlrnum edit should work.

My suggestion is "quick and dirty", correcting the edit is the best solution.

Richard Kreiss
GCC Consulting 




More information about the Filepro-list mailing list