Warning: Undefined array key "birthday_search" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 173

Warning: Undefined array key "joindate" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 190

Warning: Undefined array key "posts" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 191

Warning: Undefined array key "posts" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 197

Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 6509

Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 212

Warning: Undefined array key "privacy_options" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/api/user.php on line 251

Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 4998

Warning: Undefined array key "userid" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 1585

Warning: Undefined array key "lastactivity" in phar:///home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb/vb.phar/library/user.php on line 1601

Warning: Trying to access array offset on value of type bool in /home/duptmor/public_html/prod.mcpressonline.com/forum/core/vb5/route/profile.php on line 74
Opening XLS to read - path name is too long - MC Press Online Forums

Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Opening XLS to read - path name is too long

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Opening XLS to read - path name is too long

    I'm trying to use AIR09_02 as a template to open an XLS file. In my program the stream file name has to be a variable. I looked at the prototype for AirExcel_getWorkbook and defined my input parameter accordingly.

    D #lcstmf s 1024a varying

    The function call looks like this:
    airWorkbook = AirExcel_getWorkbook(#lcstmf);

    I'm getting the following error:
    Message . . . . : Java exception received when calling Java method.Cause . . . . . : RPG procedure AIREXCEL_G in program AIRLIB/SVAIREXCEL received Java exception "java.io.FileNotFoundException: A path name is too long. /adp/1.xls" when calling method "" with signature "(Ljava.lang.StringV" in class "java.io.FileInputStream".

    When I first got this message, I actually thought the real file name was too long...so I renamed it 1.xls to test but I'm still getting the "path name too long" message.

    What am I doing wrong?

  • #2
    Try using trim around your string buffer. Varying uses the first two bytes for your length. Also, when passing bytes of characters (RPG character Variables) it will use the whole string for your filename; including the spaces.

    This should get you where you're headed:
    airWorkbook = AirExcel_getWorkbook(%trim(#lcstmf));

    %trim is your friend when going back and forth between RPG with Java using strings.
    Last edited by Guest; 10-07-2010, 12:08 PM. Reason: Clarification on spaces for Character Bytes

    Comment


    • #3
      That did it. THANKS AGAIN!!

      Comment

      Working...
      X