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



This is a multipart message in MIME format.
--
[ Picked text/plain from multipart/alternative ]
Ping,

We're losing something in the translation.  Poor fellow, it sounds like we
have you terribly confused.

When you do a SBMJOB you have a parameter called CMD.  Traditionally
people put in here a CALL command and then call their program directly.
However, when dealing with numeric parameters you can get into big
trouble.

Let's say you have a RPG program which calls another program.  The first
program has a screen which processes some information and passes it to the
second program.  And maybe this second program is rather intensive and you
want that to run in batch.  Then you may have the following in your first
program:

     C                     CALL 'MYPGM'
     C                     PARM           MYNBR   50

Then you create a source member of type CMD.  And this may contain:
             CMD        PROMPT('Your description here')
             PARM       KWD(MYNBR) TYPE(*DEC) LEN(5) MIN(1) CHOICE('Valid
+
                          number') PROMPT('Enter number here')
To compile this you do
CRTCMD CMD(MYLIB/MYPGM) PGM(MYLIB/MYPGM)

To see how this looks you can they type in the following at a command line
MYPGM and hit <F4> and you will get a prompt screen.  Yes, you can design
a 400 screen with so few lines of code.


And your second program may have:
PGM (                                                                +
      &PARM1           /* My numeric variable                     */ +
      &PARM2           /*                                         */ +
    )

    DCL  &PARM1       *DEC    5  /* My numeric variable              */
    DCL  &JOBINFO     *CHAR   1  /* 1=Interactive, 0=Batch           */

    /*     +
     | Retrieve current job type     +
    */
             RTVJOBA    TYPE(&JOBINFO)

    /*     +
     | Submit job if currently interactive     +
    */
             IF         COND(&JOBINFO = '1') THEN(DO)
             SBMJOB     CMD(MYPGM MYNBR(&MYNBR))
             GOTO       CMDLBL(END)
             ENDDO

    /*     +
     | Do your real processing here     +
    */

END:

             ENDPGM


Do you see how this second program will submit itself using this new
command we created?

Rob Berendt
--
"They that can give up essential liberty to obtain a little temporary
safety deserve neither liberty nor safety."
Benjamin Franklin




"Ren Fu Ping" <fupingren@yeah.net>
Sent by: rpg400-l-admin@midrange.com
04/15/2002 09:55 AM
Please respond to rpg400-l


        To:     <rpg400-l@midrange.com>
        cc:
        Fax to:
        Subject:        Re: Error Message


But the command can't include PARM option, the system of log is prompt the
option is only for resource file. How to deal?



----- Original Message -----
From: <rob@dekko.com>
To: <rpg400-l@midrange.com>
Sent: Monday, April 15, 2002 10:43 PM
Subject: Re: Error Message


> This is a multipart message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
> Denis is correct.  It is a shame that noone has written a faq on this.
> This faq should include a very simple CMD source to help replace the
call.
>  Anyone up to the challenge?
>
> Rob Berendt
> --
> "They that can give up essential liberty to obtain a little temporary
> safety deserve neither liberty nor safety."
> Benjamin Franklin
>
>
>
>
> "Denis Robitaille" <DRobitaille@cascades.com>
> Sent by: rpg400-l-admin@midrange.com
> 04/15/2002 08:31 AM
> Please respond to rpg400-l
>
>
>         To:     <rpg400-l@midrange.com>
>         cc:
>         Fax to:
>         Subject:        Re: Error Message
>
>
> This problem has been seen and discussed a lot before. I will try to
> explain:
>
> When your CL program submit to batch the RPG program, a string like the
> following is sent to the jobq:
>
> CALL PGM(RPGPGM) PARM(12345)
>
> Where 12345 is the value of the numeric parameter that you are passing
> to the program. Since when the job starts in batch, it does not know the
> structure of 12345, the system assume a packed numeric filed of 15 digit
> with 5 decimal position (15P5). Your Rpg program is certainly expecting
> a number formatted differently.
>
> There are several work around for this situation. Here are the 2 main
> one that I know:
> - use 15p5 numeric parameters in all 3 programs
> - use a command to call the second RPG. By submitting a command instead
> of a direct call, the structure of the different parameters willm be
> known when the programs statrs.
>
> hope this help
>
> Denis Robitaille
> Directeur services techniques
> Cascades Inc
> 819 363 5187
>
>
> >>> fupingren@yeah.net 04/15/02 08:23am >>>
> This is a multi-part message in MIME format.
> --
> [ Picked text/plain from multipart/alternative ]
>  Message ID . . . . . . :   RPG0907
>  Date sent  . . . . . . :   02/04/15      Time sent  . . . . . . :
> 20:11:15
>
>  Message . . . . :   INVX01B 4900 decimal-data error in field (C G S D
> F).
>
>  Cause . . . . . :   The RPG program INVX01B in library DERFP found a
>    decimal-data error at statement 4900. One field did not contain
> valid
>    numeric data.  The digit and/or sign is not valid.
>  Recovery  . . . :   Enter C to cancel, G to continue processing at
> *GETIN, S
>    to obtain a system dump, or D to obtain an RPG formatted dump.
>  Possible choices for replying to message . . . . . . . . . . . . . . .
> :
>    D -- Obtain RPG formatted dump.
>    S -- Obtain system dump.
>    G -- Continue processing at *GETIN.
>    C -- Cancel.
>
> More..
>
> Dear Guys,
>           I have a program mentioned before here.   I use two RPG
> programm and one CLP programm to control interactive job or batch job.
> one RPG to check display file, Then call CL programm; and CL programm is
> receive parameter from the first RPG programm, then pass this parameter
> to the second RPG programm, certainly, if the special parameter is '1',
> I will submit this job to batch, otherwise for interactive.  Problem is
> I run this programm through interactive job is very good, but run in
> batch will display error message on the above paster. Why?
>
> thanks a lot.
> Ping
>
>
>
>
> --
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
> list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
>
>
> _______________________________________________
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing
list
> To post a message email: RPG400-L@midrange.com
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
> or email: RPG400-L-request@midrange.com
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
>
_______________________________________________
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l
or email: RPG400-L-request@midrange.com
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 thread ...


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.