[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Files not received unless already created (long)



Here is a strange issue (solved).

 

Using the FTP_Get() API, I receive file IBWW_NSOpenOrders.csv to local location /tmp/idgincoming/20050502/IBWW_NSOpenOrders.csv. If the local file exists, the file is received. If the file does not exist, I receive the error No such path or directory.

 

Short story: In the parsepath() procedure, the call to CvtPath fails due to CPFA0A7 (Path name too long.) The path name is /tmp/idgincoming/20050502/IBWW_NSOpenOrders.csv. Called by OpnFile(), called by Ftp_Get(), called by my program.

 

The file is never opened and I receive the error message above (No such path or directory.) Note that if the file already exists in the full path, it is received correctly.

 

In the ParsePath, after the call to CvtPath, message id CPFA0DB is monitored (not OS400 object). The error message CPFA0A7 (Path too long) is correct because the maximum length of an OS400 library/file/member name is 32 positions, and my IFS path name is 47.

 

I changed the ParsePath procedure as follows:

 

5160.00 c?????????????????? callp???? CvtPath( Qlg_Path_Name_T

5161.00 c??????????????????????????????????? :? QSYS0100

5162.00 c??????????????????????????????????? : 'QSYS0100'

5163.00 c???????????????????? ???????????????: %size(QSYS0100)

5164.00 c??????????????????????????????????? : 0

5165.00 c??????????????????????????????????? : dsEC

5166.00 c??????????????????????????????????? )

5167.00

5168.00 c?????????????????? if??????? dsECBytesA > 0

5169.00 c??????????????????????????????? and dsECMsgID <> 'CPFA0DB'

5170.00 c??????????????????????????????? and dsECMsgID <> 'CPFA0A7'???????????????? lg 20050502

5171.00 c?????????????????? return??? -1

5172.00 c?????????????????? endif

 

I recompiled the service program, then my FTP program. It now works as expected given in inputs below. ParsePath returns normally, and OpnFile is successful. Scott, feel free to include this in the baseline if it passes your testing.

 

See below for the gory details.

 

Thanks,

Loyd

 

 

 

 

 

Here is the call:

rc = ftp_get( fd : incoming(fileno) : retrievefile );

 

Program call values:

fd = 3

fileno = 1

Incoming(fileno) = > EVAL incoming(1):x

????? 00000???? C9C2E6E6 6DD5E2D6 978595D6 99848599?? - IBWW_NSOpenOrder

????? 00010???? A24B83A2 A5404040 40404040 40404040?? - s.csv

????? 00020???? 40404040 40404040 40404040 40404040?? -

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

Retrievefile = ?> EVAL retrievefile:x

????? 00000???? 61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00010???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00020???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

 

I debugged through the FTPAPIR4 service program:

 

ftp_get()

pssocket = 3

peremote = ?> EVAL peremote:x

????? 00000???? C9C2E6E6 6DD5E2D6 978595D6 99848599?? - IBWW_NSOpenOrder

????? 00010???? A24B83A2 A5404040 40404040 40404040?? - s.csv

????? 00020???? 40404040 40404040 40404040 40404040?? -

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

pelocal = ?> EVAL pelocal:x

????? 00000?? ??61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00010???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00020???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00030???? 40404040 40404040 40404040 40404040 ??-

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

??? ??000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

 

… calls initftpapi() – OK

… calls selectsession() - OK

… calls ftp_size() – returns 14084 (wktotbytes)

… calls opnfile()

 

Parameters:

Wwlocal = ?> EVAL wwlocal:x

????? 00000???? 61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00010???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00020???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

????? 00100???? 40...... ........ ........ ........?? -? ...............

‘W’

P_write = *NULL

P_close = *NULL

 

opnfile()

pepath = ?> EVAL pepath:x

????? 00000???? 61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00010???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00020???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

perwflag = ‘W’

perdwrproc = *NULL

peclosproc = *NULL

 

… calls fixpath() – OK, /tmp/idgincoming/20050502/IBWW_NSOpenOrders.csv

Wwtype = *blanks

Wwcp = 37

Wwexists = *off

Wwnew = *on

 

If wwtype=’*FILE’ or wwtype=’*MBR’ or wwexists = *off????????? ?// true

… calls parsepath()

 

 

 

ERROR OCCURS IN PARSEPATH

 

 

 

Parameters:

Wwpath = ?> EVAL wwpath:x

????? 00000???? 61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00010???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00020???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00030???? 40404040 40404040 40404040 40404040?? -

????? 00040???? 40404040 40404040 40404040 40404040?? -

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

????? 00100???? 40...... ........ ........ ........?? - ?...............

Wwlib = *blanks

Wwobj = *blanks

Wwtmpmbr =*blanks

Wwtmptype = *blanks

 

Parsepath()

Line 5340:

path_length = 47

 

Line 5343: if??????? Path_Length > 5?? // true, 47

Line 5350: WWCHKSAVF = 'S.cSV' // after %subst and xlate

Line 5352:

callp???? CvtPath( Qlg_Path_Name_T

???????????????? :? QSYS0100

???????????????? : 'QSYS0100'

???????????????? : %size(QSYS0100)

???????????????? : 0

???????????????? : dsEC

???????????????? )

 

if??????? dsECBytesA > 0

???????????? and dsECMsgID <> 'CPFA0DB'

return??? -1

endif

 

Parameters for CvrPath:

Qlg_Path_Name_T = ?> EVAL qlg_path_name_t:x

????? 00000???? 00000025 E4E2C5D5 E4000000 00000000?? - ....USENU.......

????? 00010???? 0000002F 61400000 00000000 00000000?? - ..../ ..........

????? 00020???? 61A39497 61898487 89958396 94899587?? - /tmp/idgincoming

????? 00030???? 61F2F0F0 F5F0F5F0 F261C9C2 E6E66DD5?? - /20050502/IBWW_N

????? 00040???? E2D69785 95D69984 8599A24B 83A2A540?? - SOpenOrders.csv

????? 00050???? 40404040 40404040 40404040 40404040?? -

????? 00060???? 40404040 40404040 40404040 40404040?? -

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0?? ??40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

????? 000D0???? 40404040 40404040 40404040 40404040?? -

????? 000E0???? 40404040 40404040 40404040 40404040?? -

????? 000F0???? 40404040 40404040 40404040 40404040?? -

????? 00100???? 40404040 40404040 40404040 40404040?? -

????? 00110???? 40404040 40404040 40404040 40404040?? -

Length of path is 47 = 2Fh (byte (offset 13 above)

 

After call to CvtPath:

> EVAL dsec

?? DSECBYTESP OF DSEC = 1016

?? DSECBYTESA OF DSEC = 114

?? DSECMSGID OF DSEC = 'CPFA0A7'

?? DSECRESERV OF DSEC = '0'

?? DSECMSGDTA OF DSEC =

???????????? ....5...10...15...20...25...30...35...40...45...50...55...60

??????? 1?? '?? ; ­ È _ ø ­ Ñ À Å Ñ > Ä ? _ Ñ > Å ­ ­ ­ ­ ­ ­ ­ ­ ­ ­ ñ â'

?????? 61?? ' ï ï ¬ + ë | ø Á > | Ê À Á Ê Ë ­ Ä Ë Î????????????????????? '

????? 121?? '??????????????????????????????????????????????????????????? '

????? 181?? '??????????????????????????????????????????????????????????? '

????? 241?? '??????????????????????????????????????????????????????????? '

????? 301?? '??????????????????????????????????????????????????????????? '

????? 361?? '????????????????? ??????????????????????????????????????????'

> EVAL dsecmsgdta:x

????? 00000???? 0000005E 002F0074 006D0070 002F0069?? - ...;...È._.ø...Ñ

????? 00010???? 00640067 0069006E 0063006F 006D0069?? - .À.Å.Ñ.>.Ä.?._.Ñ

????? 00020???? 006E0067 002F0032 00300030 00350030?? - .>.Å............

????? 00030???? 00350030 0032002F 00490042 00570057?? - .........ñ.â.ï.ï

????? 00040???? 005F004E 0053004F 00700065 006E004F?? - .¬.+.ë.|.ø.Á.>.|

????? 00050???? 00720064 00650072 0073002E 00630073?? - .Ê.À.Á.Ê.Ë...Ä.Ë

????? 00060???? 00764040 40404040 40404040 40404040?? - .Î

????? 00070???? 40404040 40404040 40404040 40404040?? -

????? 00080???? 40404040 40404040 40404040 40404040?? -

????? 00090???? 40404040 40404040 40404040 40404040?? -

????? 000A0???? 40404040 40404040 40404040 40404040?? -

????? 000B0???? 40404040 40404040 40404040 40404040?? -

????? 000C0???? 40404040 40404040 40404040 40404040?? -

 

Looked up message ID CPFA0A7:

Opt? Message ID? Severity? Message Text

????? CPFA0A7?????? 40???? Path name too long.

 

In the code, CPFA0DB is already monitored.

 

Opt? Message ID? Severity? Message Text

????? CPFA0DB?????? 40???? Object not a QSYS.LIB object.? Object is &1.

 

ParsePath returns -1

OpnFile returns -1

Ftp_Get returns -1

 

 

 

 

 

 

 

 

 

Loyd Goodbar

Senior programmer/analyst

BorgWarner

E/TS Water Valley

662-473-5713