× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: CCSID, codepage, or some such thing on an IFS file, perhaps?
  • From: Scott Klement <klemscot@xxxxxxxxxxxx>
  • Date: Wed, 18 Apr 2001 15:13:00 -0500 (CDT)


If you want the system to automatically convert from the file's 
codepage to your job's codepage, you need to specific "O_TEXTDATA" on
your call to open().

Otherwise, no conversion will be done.    

Also...  although this isn't actually causing a problem, you might be
interested to know that the DEFAULT codepage when opening with O_TEXTDATA
is the one that's already assigned to the file.    Therefore, you don't
really need to do a stat() to get the codepage, you can simply not
specify it and let it do the work.

HTH


On Wed, 18 Apr 2001 rob@dekko.com wrote:

> 
> I grabbed onto some code used previously in the SNDEMAIL utility to read an
> IFS file for me.  What I am trying to do is to read the IFS file which
> contains a list of Domino servers and create a list user space out of it.
> 
> First of all when I use DSPF to look at the file
> /QIBM/UserData/LOTUS/LOTUS_SERVERS, I see:
>  ************Beginning of data**************
> SERVER=GDISYS
> TYPE=DOMINO
> DIRECTORY=/notes/data
> SBSD=DOMINO01
> PARTITION=1
> LIBRARY=QNOTES
> EXEPATH=/QIBM/PRODDATA/LOTUS/NOTES
> CRTREL=5.0.6
> CURREL=5.0.6
> INFO=
> SERVER=GDISYS01
> TYPE=DOMINO/QUICKPLACE
> DIRECTORY=/GDISYS01/NOTES/DATA
> SBSD=DOMINO02
> PARTITION=2
> LIBRARY=QNOTES
> EXEPATH=/QIBM/PRODDATA/LOTUS/NOTES
> CRTREL=5.0.6
> ...
> When ran in debug I am getting:
> EVAL dataread :x
>    00000     00530045 00520056 00450052 003D0047   - .ë.á.ê.î.á.ê...å
>    00010     00440049 00530059 0053000A 00540059   - .à.ñ.ë.ß.ë...è.ß
>    00020     00500045 003D0044 004F004D 0049004E   - .&.á...à.|.(.ñ.+
>    00030     004F000A 00440049 00520045 00430054   - .|...à.ñ.ê.á.ä.è
>    00040     004F0052 0059003D 002F006E 006F0074   - .|.ê.ß.....>.?.È
>    00050     00650073 002F0064 00610074 0061000A   - .Á.Ë...À./.È./..
>    00060     00530042 00530044 003D0044 004F004D   - .ë.â.ë.à...à.|.(
>    00070     0049004E 004F0030 0031000A 00500041   - .ñ.+.|.......&.
>    00080     00520054 00490054 0049004F 004E003D   - .ê.è.ñ.è.ñ.|.+..
>    00090     0031000A 004C0049 00420052 00410052   - .....<.ñ.â.ê. .ê
>    000A0     0059003D 0051004E 004F0054 00450053   - .ß...é.+.|.è.á.ë
>    000B0     000A0045 00580045 00500041 00540048   - ...á.ì.á.&. .è.ç
>    000C0     003D002F 00510049 0042004D 002F0050   - .....é.ñ.â.(...&
> ST_CODEPAGE = 1200
> What the hex?
> 1)  It looks like a null is added before every character.
> 2)  It looks like most of the hex values are off.  For example, in the
> above S is claimed to be hex 53, E hex 45, R hex 52 and so on.
> 
> Some of the code:
> ...
> D*** File Access Modes for open()
> D O_RDONLY        S             10I 0 INZ(1)
> ...
> D S_IRWXU         S             10I 0 INZ(448)
> ...
> D S_IRWXO         S             10I 0 INZ(7)
> ...
> D*** misc
> D O_TEXTDATA      S             10I 0 INZ(16777216)
> D O_CODEPAGE      S             10I 0 INZ(8388608)
> ...
> D*** stat data structure
> D StatDS          DS           128
> D  st_mode                      10U 0
> D  st_ino                       10U 0
> D  st_nlink                      5U 0
> D  st_reserved1                  2A
> D  st_uid                       10U 0
> D  st_gid                       10U 0
> D  st_size                      10U 0
> D  st_atime                     10U 0
> D  st_mtime                     10U 0
> D  st_ctime                     10U 0
> D  st_dev                       10U 0
> D  st_blksize                   10I 0
> D  st_allocsize                 10I 0
> D  st_objtype                   10A
> D  st_reserved2                  2A
> D  st_codepage                   5U 0
> D  st_reserved3                 62A
> D  st_ino_gen_id                10U 0
> 
> D AttachDesc      S             10I 0
> D BytesRead       S             10I 0
> D DataRead        S           9999A
> D IfsData         S                   Like(DataRead)
> ...
>  * Open the Domino File containing the list of servers
> C                   Exsr      OpenDomino
> 
>  * Read from the Domino File containing the list of servers
> C                   Exsr      ReadDomino
> ...
>  /eject
> C     OpenDomino    BegSr
> C                   Eval      IFSFileName=%trimr(DominoFile) + Null
> C                   Exsr      RtvCodePage
> C                   Eval      AttachDesc = open(%ADDR(IFSFileName)
> C                               : O_RDONLY + O_CODEPAGE
> C                               : S_IRWXU + S_IRWXO
> C                               : st_codepage)
> C                   EndSr
>  ******************************************************************
>  *****************************************************************
>  * Retrieve code page
>  *****************************************************************
> C     RtvCodePage   Begsr
> C*** Retrieve file attributes
> C                   Eval      ReturnInt = stat(%ADDR(IFSFileName):
> C                                               %ADDR(StatDS))
> C                   If        ReturnInt <> *Zero
> C                   Clear                   st_codepage
> C                   Endif
> C***
> C                   Endsr
> C*****************************************************************
>  /eject
> C     ReadDomino    BegSr
> C                   Eval      BytesRead = read(AttachDesc
> C                               : %Addr(DataRead)
> C                               : %Size(DataRead))
> ...
> 
> 
>                               Display Attributes
> 
> Object . . . . . . :   /QIBM/UserData/LOTUS/LOTUS_SERVERS
> 
> Type . . . . . . . . . . . . . . . . . :   STMF
> 
> Owner  . . . . . . . . . . . . . . . . :   QNOTES
> System object is on  . . . . . . . . . :   Local
> Auxiliary storage pool . . . . . . . . :   1
>   Object overflowed  . . . . . . . . . :   No
> 
> Coded character set ID . . . . . . . . :   13488
> Hidden file  . . . . . . . . . . . . . :   No
> PC system file . . . . . . . . . . . . :   No
> Read only  . . . . . . . . . . . . . . :   No
> 
> Need to archive (PC) . . . . . . . . . :   Yes
> Need to archive (AS/400) . . . . . . . :   No
> 
> Last access date/time  . . . . . . . . :   04/18/01  14:16:39
> Data change date/time  . . . . . . . . :   02/26/01  11:00:22
> Attribute change date/time . . . . . . :   02/26/01  11:00:22
> 
> Size of object data in bytes . . . . . :   1714
> Allocated size of object . . . . . . . :   8192
> File format  . . . . . . . . . . . . . :   *TYPE2
> Size of extended attributes  . . . . . :   0
> Storage freed  . . . . . . . . . . . . :   No
> 
> Auditing value . . . . . . . . . . . . :   *NONE
> 
> Object domain  . . . . . . . . . . . . :   *SYSTEM
> 
> Number of hard links . . . . . . . . . :   1
> 
> Last used date . . . . . . . . . . . . :   04/18/01
> Days used count  . . . . . . . . . . . :   295
>   Reset date . . . . . . . . . . . . . :
> Allow write during save  . . . . . . . :   No
> Digitally signed . . . . . . . . . . . :   No
> File ID  . . . . . . . . . . . . . . . :
> X'0000000000000001796FA7DD00002734'
> 
> 
> 
> Rob Berendt
> 
> ==================
> Remember the Cole!
> 
> +---
> | 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
> +---
> 

+---
| 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 ...

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.