[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: Re:[sqr-users] Qpen command record-length problem



Steve, please try it without RPAD.  Here's some sample code:

begin-program
  open 'c:\sqr\test.txt' as 1 for-writing record=32000:vary
  let $line = 'abcdefg'
  let #i = 0
  while #i < 50
    write 1 from $line 
    add 1 to #i
  end-while
  write 1 from 'hijklmn'
end-program

This program generate a text file that is 51 lines long.  Every line is the 
same length - seven characters.  If you run the program in Windows, every line 
will be terminated with the standard Windows CR/LF.  If you run the program in 
Unix, every line will be terminated with the standard Unix LF.  You can FTP the 
file to Windows in "ASCII" mode, and the FTP software will convert each LF to 
CR/LF.  If you're viewing the output file in the Peoplesoft Process Monitor, I 
believe it will make the same LF to CR/LF conversion.

Because I wrote exactly 7 characters on every line, I got the same file that I 
would get with "record=7:fixed" without needing to know the record length in 
advance.



-----Original Message-----
From: sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org 
[mailto:sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org] On Behalf 
Of Jones.Steven@ups.com
Sent: Thursday, July 02, 2009 2:53 PM
To: sqr-users@sqrug.org
Subject: RE: Re:[sqr-users] Qpen command record-length problem

Thanks all for your suggestions.
  
I haven't tried getting the custom parameter collection page to add up the 
column lengths and then pass it as a hidden ask to sqr.  I am doubous that it 
would work.  Instead I opted to set a variable flag.  When on I open the file 
with the maximum row length as one of you suggested and then rpad the actual 
line to that length before writing.  This is compatible with version 6.2.  If 
the flag is off, I open using the 8.5 syntax which creates a potentially much 
narrower file.  

I didn't use vary as I needed to have MS compatible end-of-line characters 
which I couldn't seem to do with a variable file type.

As the file is potentially 181x2,000,000 rows, to be downloaded via internet, 
size mattered.  As we expect to be using version 8.5 later this year, it will 
require only turning off the switch later.
-Steve 

-----Original Message-----
From: sqr-users-bounces+jones.steven=ups.com@sqrug.org 
[mailto:sqr-users-bounces+jones.steven=ups.com@sqrug.org] On Behalf Of 
Alexander, Steven
Sent: Wednesday, July 01, 2009 5:00 PM
To: This list is for discussion about the SQR database reportinglanguage from 
Hyperion Solutions.
Subject: RE: Re:[sqr-users] Qpen command record-length problem

Can my other idea work for you?  Set the record length to 32000 varying but 
make each record the same size.

-----Original Message-----
From: sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org 
[mailto:sqr-users-bounces+steven.alexander=sanjoseca.gov@sqrug.org] On Behalf 
Of Jones.Steven@ups.com
Sent: Wednesday, July 01, 2009 3:50 PM
To: sqr-users@sqrug.org
Subject: RE: Re:[sqr-users] Qpen command record-length problem

I'm not very familiar with Ask, however the user has no idea of the value to 
put in the ASK.  The value is added up from the db column widths the user 
selects during the run, so the SQR obtains the value at run-time prior to the 
open.  Can that be somehow put in as if it came from an ASK?
-Steve

-----Original Message-----
From: sqr-users-bounces+jones.steven=ups.com@sqrug.org 
[mailto:sqr-users-bounces+jones.steven=ups.com@sqrug.org] On Behalf Of 
franck.masson
Sent: Wednesday, July 01, 2009 3:16 PM
To: This list is for discussion about the SQR database reporting language from 
Hyperion Solutions.
Subject: RE: Re:[sqr-users] Qpen command record-length problem

Have you try the Ask command as proposed in the previous email ? 



> Message du 02/07/09 00:12
> De : Jones.Steven@ups.com
> A : sqr-users@sqrug.org
> Copie à : 
> Objet : RE: Re:[sqr-users] Qpen command record-length problem
>
> 
> The sqr version I am using is 6.2. I saw that syntax in the manual for 8.5 
>but haven't been able to test it. Anyone know how to do it in 6.2?
> -Steve
> 
> -----Original Message-----
> From: sqr-users-bounces+jones.steven=ups.com@sqrug.org
> [mailto:sqr-users-bounces+jones.steven=ups.com@sqrug.org] On Behalf Of 
> franck.masson
> Sent: Wednesday, July 01, 2009 2:39 PM
> To: This list is for discussion about the SQR database reporting language 
>from Hyperion Solutions.
> Subject: Re:[sqr-users] Qpen command record-length problem
> 
> According to the documentation :
> OPEN {filename_lit|_var|_col} AS
> {filenum_num_lit|_var|_col}
> {FOR-READING|FOR-WRITING|FOR-APPEND}
> {RECORD=length_num_lit|_var|_col[:FIXED|:FIXED_NOLF|:VARY:BINARY]}]
> [STATUS=num_var]]
> [ENCODING={_var|_col|ASCII|ANSI|SJIS|JEUC|EBCDIC|
> EBCDIK290|EBCDIK1027|
> UCS-2|UTF-8|others... }]
> 
> you can use a variable to specify the RECORD value
> 
> franck,
> 
> 
> 
> 
> > Message du 01/07/09 23:09
> > De : Jones.Steven@ups.com
> > A : sqr-users@sqrug.org
> > Copie à : 
> > Objet : [sqr-users] Qpen command record-length problem
> >
> > 
> > I need to open a window-compatible .txt file for writing where all records 
>are the same length, but that length is not known until run time. The syntax 
>appears to expect an integer literal value for the length. What is needed is 
>something like either using an integer variable for the length or dynamically 
>building the open command and then execute it.
> > Can anyone help?
> > -Steve Jones
> > UPS
> > 
> > _______________________________________________
> > sqr-users mailing list
> > sqr-users@sqrug.org
> > http://www.sqrug.org/mailman/listinfo/sqr-users
> > 
> > 
> 
> Créez votre adresse électronique prenom.nom@laposte.net
> 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
> 
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org
> http://www.sqrug.org/mailman/listinfo/sqr-users
> 
> 

 Créez votre adresse électronique prenom.nom@laposte.net
 1 Go d'espace de stockage, anti-spam et anti-virus intégrés.

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users