Array Corruption

190 pts.
Tags:
Application development
CLP
RPG
Security
I have written an RPGLE pgm in which I took an array with a size of 400 (20 fields with a length of 20) and did a MOVEA to put it inside a character field of 400. I then passed this field to another program and I did a MOVEA to populate the array in the 2nd program. When I call the 2nd program interactively, the program works. When I submit the program in batch, somehow garbage gets into part of my array. I cleared the array before I did the MOVEA. HELP!!!!

Answer Wiki

Thanks. We'll let you know when a new response is added.

Is the second program also an RPGLE program and are the arrays character or numeric?

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • WickedWoman
    I would guess you are not using a prototype interface, which offers more control and would not require the array to be "strung out." I think a quick fix might be accomplished by adding a one-character field with a character value in it and passing it with the array. OS400 in the more recent releases seems to truncate long fields when passed as parameters, and sometimes shoring up the end of the passed data with something the OS recognizes will preserve that which precedes it.
    0 pointsBadges:
    report
  • LuisHernandez
    As WickedWoman said before there are some issues you need to known before use parameters with pgms. As an example, if you use the CL to run your program the parameters (in CLs) have as maximum length 256bytes (depend on your OS version). Good luck
    0 pointsBadges:
    report
  • Mrs9693nj
    Have you considered using the IMPORT / EXPORT keywords? If the arrays are being used in 2 RPGLE's you can export from the one *pgm and import to the other *pgm avoiding th e quirkiness of parm passing that some of the other respondents have mentioned. exp: *Import/Export Data Structure,Subfield Values Global d select_po# ds export d po# 7 dim(999) inz(*blanks) d hot_code 1 dim(999) inz(*blank) d prd_code 2 dim(999) inz(*blanks) * d select_po# ds import d po# 7 dim(999) inz(*blanks) d hot_code 1 dim(999) inz(*blank) d prd_code 2 dim(999) inz(*blanks) Good Luck, Mark Schroeder
    0 pointsBadges:
    report
  • TomLiotta
    Without seeing how one program passes the array to the other, there is almost no chance of guessing correctly. However... I suspect that interactively you have PgmA calling PgmB. But when you "run in batch" you have PgmA submitting PgmB. I.e., one program runs interactive and the other program runs in batch, which is a very different scenario effectively unrelated to the full interactive case. If so, this is almost certainly the usual case of trying to use the SBMJOB CMD() parameter when the correct method is to use SBMJOB RQSDTA(). You're attempting to pass a parameter longer than 32 bytes and it has trailing blanks. It will not work as you wish. Code the SBMJOB correctly and it will work. Alternatively, create a *CMD to prototype PgmB's parameter list. Then SBMJOB CMD() will also work. The CMD() parameter is intended for *CMDs that set data types for parms. The CALL command provides no data typing information. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following