|
Send RPG400-L mailing list submissions to
rpg400-l@xxxxxxxxxxxx
To subscribe or unsubscribe via the World Wide Web, visit
http://lists.midrange.com/mailman/listinfo/rpg400-l
or, via email, send a message with subject or body 'help' to
rpg400-l-request@xxxxxxxxxxxx
You can reach the person managing the list at
rpg400-l-owner@xxxxxxxxxxxx
When replying, please edit your Subject line so it is more specific
than "Re: Contents of RPG400-L digest..."
*** NOTE: When replying to this digest message, PLEASE remove all text unrelated to your reply and change the subject line so it is meaningful.
Today's Topics:
1. Re: Creating a pipe delimited file <Prvidate Reply>
(Richard Reeve)
2. Re: RPG on other platforms? (Jon Paris)
3. Re: Overflow and INOF with Externam Printer file (Bradley Stone)
4. Re: RPG on other platforms? (Scott Klement)
5. Re: Help creating a pipe delimited file (Henrik R?tzou)
6. Re: RPG on other platforms? (Nathan Andelin)
----------------------------------------------------------------------
message: 1
date: Thu, 17 Jul 2014 21:23:32 -0400
from: Richard Reeve <rjrjr64@xxxxxxxxx>
subject: Re: Creating a pipe delimited file <Prvidate Reply>
Hi Alan,
That would be awesome. My deadline is Monday so all of this help from
the group is overwhelming and very much appreciated. They are on V6R1.
Many thanks to all.
Rich
On Thu, Jul 17, 2014 at 6:12 PM, Alan Campin <alan0307d@xxxxxxxxx> wrote:
Richard, don't know if you would interested but i can send you a save file
with an API that I wrote called XVIFSX, some documentation and an example
program that does what you are talking about.
XVIFSX is a service program that wrappers the Unix API that people have
been talking about so that you don't have to know anything about them. Just
use the API. Pretty simple.
What release level is your OS/400 at. The save file is at V6R1M0.
Here is what the example program looks like.
*_> CNLLSTSPLF SRCFILE(@SRCLIB/@SRCFIL) SRCMBR(@SRCMBR)
*_> DLTMOD MODULE(@OBJLIB/@OBJNAM)
*_> DLTPGM PGM(@OBJLIB/@OBJNAM)
*_> CRTSQLRPGI OBJ(@OBJLIB/@OBJNAM) +
*_> SRCFILE(@SRCLIB/@SRCFIL) +
*_> SRCMBR(@SRCMBR) DATFMT(*ISO) +
*_> OBJTYPE(*MODULE) CLOSQLCSR(*ENDMOD) COMMIT(*NONE) +
*_> DBGVIEW(*SOURCE) OPTION(*EVENTF)
*_> CRTPGM PGM(@OBJLIB/@OBJNAM) +
*_> MODULE(@OBJLIB/@OBJNAM) +
*_> TEXT('Build file') +
*_> BNDSRVPGM(XVIFSX) +
*_> ACTGRP(EXAM)
h Option(*Srcstmt:*Nodebugio:*Nounref)
h Main(BuildFile)
/copy *libl/qsrcf,cb_std_con
/copy *libl/qsrcf,cb_stdtype
/copy *libl/qsrcf,xvifsx_pr
d BuildFile...
d pr ExtPgm('EXAMPLEIFS')
d BuildLine...
d pr
d PR_InOutLine...
d 80a Varying
d PR_InString...
d 32a Varying
d Options(*Trim)
d Value
d PR_InDelimitor...
d 1a Value
d Options(*NoPass)
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* BuildFile
* Build an IFS file from database table
* In - None
* Out - None
* In/Out - None
* Returns - None
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p BuildFile...
p b
d pi
d RecordIn...
d ds Qualified
d Key...
d 11p 0
d Name...
d 20a
d Area...
d 3p 0
d Phone...
d 7p 0
d Id...
d s Like(StdInt)
d Line...
d s 80a Varying
/Free
Exec Sql Declare C1 Cursor For
Select UPHKY,
ULNAM,
UAREA,
UPHON
From PHPUNIT;
Exec Sql Open C1;
Id = XVIFSX_OpenText('/home/acampin/script.txt':
O_CREAT + O_TRUNC +
O_WRONLY + O_CCSID +
O_TEXTDATA + O_TEXT_CREAT:
S_IRWXU + S_IRWXG + S_IRWXO:
819:
0);
DoU 0 = 1;
Exec Sql Fetch From C1
Into :RecordIn;
Select;
When SqlState = cSqlStateNoRow;
Exec Sql Close C1;
XVIFSX_WriteText(Id:
cTrue:
Line);
XVIFSX_CloseFile(Id);
Return;
When SqlState = cSqlStateOk;
BuildLine(Line:
%Editc(RecordIn.Key:'L'));
BuildLine(Line:
RecordIn.Name:
',');
BuildLine(Line:
%Editc(RecordIn.Area:'X'):
',');
BuildLine(Line:
%Editc(RecordIn.Phone:'X'):
',');
XVIFSX_WriteText(Id:
cTrue:
Line);
Other;
Dsply SqlState;
EndSl;
EndDo;
/End-Free
p e
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
* BuildLine
* Builds a line.
* In - String to write
* Delimitator(Optional)
* Out - None
* In/Out - Line To Build
* Returns - None
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
p BuildLine...
p b
d pi
d InOutLine...
d 80a Varying
d InString...
d 32a Varying
d Options(*Trim)
d Value
d InDelimitator...
d 1a Value
d Options(*NoPass)
/Free
If %Parms() = 3;
InOutLine += (InDelimitator + InString);
Else;
InOutLine += InString;
EndIf;
Return;
/End-Free
p e
------------------------------
message: 2
date: Thu, 17 Jul 2014 23:49:45 -0400
from: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
subject: Re: RPG on other platforms?
Some of the porting vendors used to offer an RPG IV compiler option. Don't know the current names of any of them though.
California Software - if they still exist may have one. There was also a PC based one about 3 years ago that was a resurrection of an older compiler - not sure what happened to it. Since I have no interest in moving stuff off IBM i I have not kept up to date.
There are also a couple of convertors out there that will convert it to Java, C++ or C#. No personal experience.
On 2014-07-17, at 1:27 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:
I don't think you'll find an ILE RPG compiler for any other platforms.Jon Paris
Someone will probably mention a product from ASNA. But I don't think you'll
find any compiler that is even 70% cross-platform compatible with ILE RPG.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
www.partner400.com
www.SystemiDeveloper.com
------------------------------
message: 3
date: Thu, 17 Jul 2014 22:57:53 -0500
from: Bradley Stone <bvstone@xxxxxxxxx>
subject: Re: Overflow and INOF with Externam Printer file
Sorry, Robert. INOF means *INOF. Yes
For the others, I think we're seeing the catch 22. Some suggest if you
don't reference it, it won't be available.
BUT,
The issue here is, if I reference it (ie... if *INOF) I get an error on
compile saying it's undefined.
On Thu, Jul 17, 2014 at 6:07 PM, Robert Rogerson <rrogerson@xxxxxxxxxxx>
wrote:
Hi Brad, this may sound silly but when your refer to INOF you are meaning
*INOF correct? There isn't a variable called INOF is there?
Rob
On 7/17/2014 4:52 PM, Bradley Stone wrote:
Booth,--
Ya, we've already been over that.
FFD001P1 O E PRINTER OFLIND(*INOF) USROPN
Doesn't work. It won't let you use *INOF on the F spec of an externally
described printer file.
All I know is I have one program that has:
FFD001P1 O E PRINTER USROPN
And INOF shows up in the compile listing and it works fine as it should.
I create a program with just that F spec, turn on LR as the only c spec
and
INOF doesn't show up in the compile listing.
I know it's something simple, and so obvious and I'm going to wake up in
the middle of the night screaming AHA! at one point. lol..
Brad
On Thu, Jul 17, 2014 at 3:03 PM, Booth Martin <booth@xxxxxxxxxxxx> wrote:
*INOF is a named indicator, just like *INLR or *IN99 and can be set on
and off in an RPG program, and used just like any other indicator by the
program. Even if there is no printer file.
If you want *INOF set on by overflow in an external printer file then you
want an F-spec like this:
FFD001P1 O E PRINTER OFLIND(*INOF) USROPN
I have not tested that, so be careful. I do, from time to time, make
mistakes.
On 7/17/2014 2:27 PM, Bradley Stone wrote:
Thanks Jeff.
Yes, that makes sense. But I have a few programs than have externallyBooth Martin
described Printer files and Use *INOF. I just can't figure out how. :)
Brad
--
www.martinvt.com
(802)461-5349
Skype: booth.martin
I maintain there is much more wonder in science than in pseudoscience.
And
in addition, to whatever measure this term has any meaning, science has
the
additional virtue, and it is not an inconsiderable one, of being true. --
Carl Sagan, The Burden Of Skepticism, The Skeptical Inquirer, Vol. 12,
Fall
87
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
------------------------------
message: 4
date: Thu, 17 Jul 2014 21:56:03 -0700
from: Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx>
subject: Re: RPG on other platforms?
Jon,
I think California Software is now "Infinite Corporation".
http://www.infinitecorporation.com
Baby/400 is now known as "Infinite i", and Baby/36 as "Infinite 36"
I just know this from their ads. I haven't used their products, and I
don't think I know anyone who has...
-SK
On 7/17/2014 8:49 PM, Jon Paris wrote:
Some of the porting vendors used to offer an RPG IV compiler option. Don't know the current names of any of them though.
California Software - if they still exist may have one. There was also a PC based one about 3 years ago that was a resurrection of an older compiler - not sure what happened to it. Since I have no interest in moving stuff off IBM i I have not kept up to date.
There are also a couple of convertors out there that will convert it to Java, C++ or C#. No personal experience.
On 2014-07-17, at 1:27 PM, Nathan Andelin <nandelin@xxxxxxxxx> wrote:
I don't think you'll find an ILE RPG compiler for any other platforms.Jon Paris
Someone will probably mention a product from ASNA. But I don't think you'll
find any compiler that is even 70% cross-platform compatible with ILE RPG.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
www.partner400.com
www.SystemiDeveloper.com
------------------------------
message: 5
date: Fri, 18 Jul 2014 10:41:17 +0200
from: Henrik R?tzou <hr@xxxxxxxxxxxx>
subject: Re: Help creating a pipe delimited file
Rich
You can download powerEXT Core and use the csvNode support to create
the file, here is a program example:
/copy qsrc,pxapihdr General H-Spec's
* powerEXT API Connectors
/copy qsrc,pxapicgicn Basic HTTP connecter & Basic Services
/free
clearsrvpgm();
setContent('*none');
csvDelimiter('|');
csvNode('01');
csvNode('FILE DESWCRIPTION');
csvNode('20140717');
csvNode('HOSPF001');
csvNode(' ');
csvNode(' ');
csvNode(' ');
csvNode(' ');
csvNode('10');
csvNode('123456789');
csvNode('123456789');
csvNode('111223333');
csvNode('LAST NAME');
csvNode('FIRST NAME');
csvNode('MIDDLE NAME');
csvNode('SUFFIX');
csvNode('ALIAS LST NAME');
csvNode('NICKNAME');
csvEndNode();
echoToStmf('/csvtest2.txt':819);
*inlr = *on;
/end-free
This code generates an IFS file like this:
01|"FILE DESWCRIPTION"|20140717|"HOSPF001"|||||
10|123456789|123456789|111223333|"LAST NAME"|"FIRST NAME"|"MIDDLE
NAME"|"SUFFIX"|"ALIAS LST NAME"|"NICKNAME"|
On Fri, Jul 18, 2014 at 12:41 AM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:
On Thu, Jul 17, 2014 at 4:47 PM, Buck Calabro <kc2hiz@xxxxxxxxx> wrote:
If you wanted to, you could use the QUSLFLD API to list the fields inhttp://iprodeveloper.com/rpg-programming/apis-example-list-fields-quslfld
each file and set up automatic code to deal with each one, whether you
need to edit numeric fields, trim character fields, etc. Carsten wrote
an article on that:
This has a bit of a learning curve.Yeah, probably too much for his deadline. If he were going to put in
that level of effort, he might as well just learn enough Python to do
his task (which isn't a lot).
Step 2 would be to write an RPG program that reads the work file by keyUm, I suspect it would actually be quicker and simpler, once he's set
and writes only the text field out to the IFS. Scott's IFS APIs can
help, as might Jon's RPGOA article. Either one is easy to use and will
not impose a huge learning curve. Basically just READ the table and
write() the IFS file.
up the work file with the keys, to use files and CL commands,
particularly if he isn't already versed in working with IFS stream
files. For example, RGZPFM the work file. Copy it to another
workfile, which doesn't have the keys, using FMTOPT(*MAP *DROP). Then
CPYTOSTMF.
I don't miss dealing with home grown EDI one bit.I hear you, and I doubt it's many people's idea of a fun project. But
it is stunningly less painful if you use Python (or similar-level
language). All that delimiter stuff, heterogeneous data types (even
if not known until run time), and especially the quoting if that's
something you need to do, just goes away (because well-established
libraries to do all that are either already included or just a free
download away, and whatever logic is left that isn't in those
libraries tends to be easier to write in Python than in RPG).
John Y.
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.