Yes that was the first syntax I tried, it strips off the trailing blanks

Karen

 

 

 

-----Original Message-----
From: Dennis McGrath <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Tue, Jan 6, 2015 8:44 am
Subject: [RBASE-L] - Re: Fixed field file



oops, I see you already tried that.
 
Have you tried this instead?
 
SELECT ( LJS(SGET(policy_no,12,1),50) + LJS(tmpUniqueText,50) + LJS(ssn,9) + 
LJS(firstname,50) +
  + .......    + SFIL(' ',675) )=1450 +


 

From: [email protected] [mailto:[email protected]] On Behalf Of Dennis McGrath
Sent: Tuesday, January 06, 2015 8:34 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Fixed field file

 
How about adding a CR character at the end?
2 cR’s may not be a problem, it is the LF that makes a new line.
 
Dennis McGrath
 
From: [email protected] [mailto:[email protected]] On Behalf Of Karen Tellef
Sent: Tuesday, January 06, 2015 7:58 AM
To: RBASE-L Mailing List
Subject: [RBASE-L] - Re: Fixed field file
 
I had posted earlier that I had tried that.  A char(255) worked but it left a 
visible character at the end of the row and they didn't like it -- it wasn't 
"blank" according to them

Karen

 

 

-----Original Message-----
From: Bill Downall <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Mon, Jan 5, 2015 5:57 pm
Subject: [RBASE-L] - Re: Fixed field file

Karen, 

 

Before you give up, try a variable as =(SFIL(' ',674) + char(255)) and the 
SELECT above.

 

That's usually a non-breaking space, and there's a chance that it won't blow up 
the process at the receiving end.

 

Bill


 

On Mon, Jan 5, 2015 at 6:43 PM, Karen Tellef <[email protected]> wrote:
Thanks but nope, it still does not retain the 675 sfil-ed spaces at the end.

Looks like maybe I will have to resort to using a cursor with a 
sfil/sput/write.  I don't want to do that because there are thousands of rows 
to cursor through, and this one select is almost instantaneous.


Karen

 

 

-----Original Message-----
From: Bill Downall <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Mon, Jan 5, 2015 5:20 pm
Subject: [RBASE-L] - Re: Fixed field file

Karen,

SELECT that way does its own CR/LF.

How about:
SET V v675spaces TEX = (SFIL(' ', 675))
...Blah blah
SELECT ( LJS(SGET(policy_no,12,1),50) + LJS(tmpUniqueText,50) + LJS(ssn,9) + 
LJS(firstname,50) +
  + .......    + .v675spaces   )=1450 +
  FROM tmpMIB

Bill

(sent from Android mobile)

On Jan 5, 2015 6:10 PM, "Karen Tellef" <[email protected]> wrote:


Well, Albert's solution ALMOST works.  It does indeed put a carriage return 
exactly where I want it, so it retains the 675 blank spaces at the end.  
However, it puts an extra carriage return (therefore a blank row) between each 
row of data.  Is there a way to suppress that, like a "write.... continue" 
would?  Here's the relevant code and how different "vCRLF" variables evaluated:

SET WIDTH 1500
SET VAR vCRLF = (CHAR(013))
SET HEADINGS OFF
SET SELMARGIN 1
OUTPUT MIB.TXT
SELECT ( LJS(SGET(policy_no,12,1),50) + LJS(tmpUniqueText,50) + LJS(ssn,9) + 
LJS(firstname,50) +
  + .......    + (SFIL(' ',675)) + .vCRLF    )=1450 +
  FROM tmpMIB
OUTPUT SCREEN


Value of vCRLF:
char(013) + char(010)    this puts a blank row between each data row
char(013)    same as above
char(010)    does not retain the blank spaces, does a carriage return right 
after last data

Karen

 

 

-----Original Message-----
From: Albert Berry <[email protected]>
To: RBASE-L Mailing List <[email protected]>
Sent: Sun, Jan 4, 2015 6:18 pm
Subject: [RBASE-L] - Re: Fixed field file

Would something like this work to create the line? Assumption is no CRLF at the 
end of the variable .vDataLine.

SELECT (DataLine + (SFIL(' ',675)) + .vCRLF) FROM ...

Albert



On 1/4/2015 1:14 PM, Karen Tellef wrote:

I need to create a file with fixed field lengths.  Rather than doing SFIL/SPUT 
I did a "select" statement and it works great and is easy to code, except...

I need to have 675 blank spaces at the end of each line and I can't figure out 
how to do that using a "select" statement.  Has anyone done that, or do I need 
to use SFIL/SPUT.    According to my notes, if I use SFIL/SPUT I'll have to use 
a cursor and then do something like this (and thanks to whoever originally 
posted this code and I saved it):

   --Add CarriageReturn/LineFeed charaters to the line

Set var vDataLine = (SPUT(.vDataLine,.vCRLF,.vPastEnd))

 

  --Make sure no trash data exists beyond CR/LF

Set var vDataLine = (SGET(.vDataLine,..vTotalLength,1))

 

  --Write the line, telling RBASE not to add its own CRLF

 WRITE .vDataLine  CONTINUE

 

 

Karen

 

 
-- 
A democracy ..." can only exist until the majority discovers it can vote itself 
largess out of the public treasury."
Attributed to Alexander Fraser Tytler 1747-1813





 



Reply via email to