Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Send Spool File Via TCP/IP

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

  • Send Spool File Via TCP/IP

    We are in the process to change our actual F50 (v3r2) to a new 720 V4R4. I would like to bring a few spool files (around 100) into our new 720. I want to avoid keying for the 100 spool files the command SNDTCPSPLF. Because it's working if I do it one by one. I want to create a CLP where I will do a WRKOUTQ OUTQ(XXX) OUTPUT(*PRINT). From that spool file, use the CPYSPLF to a file that I previously created with a lenght of 133. I use CPYSPLF FILE(XXX) TOFILE(my file) JOB(QPADEV0001) USER(myself) NBR(123456) SPLNBR(*LAST) CTLCHAR(*FCFC). This is a a part of my CL. READ: RCVF MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(ENDREAD)) CHGVAR VAR(&SPLF) VALUE(%SST(&OUTQFILE 12 10)) CHGVAR VAR(&JOBN) VALUE(%SST(&OUTQFILE 92 10)) CHGVAR VAR(&USRN) VALUE(%SST(&OUTQFILE 23 10)) CHGVAR VAR(&JOBNBR) VALUE(%SST(&OUTQFILE 103 6)) CHGVAR VAR(&SPLNBR@) VALUE(%SST(&OUTQFILE 83 4)) CHGVAR VAR(&SPLNBR#) VALUE(&SPLNBR@) SNDTCPSPLF RMTSYS('DITIS2') PRTQ(&TOOUTQ) FILE(&SPLF) + JOB(&JOBNBR/&USRN/&JOBN) SPLNBR(&SPLNBR#) MONMSG MSGID(CPF0000) GOTO CMDLBL(READ) ENDREAD: This is my problem. I am getting an error on RCVF command (error:CPF0818 "The value to be converted and the receiving field are different data types.) Is there something else I can try ?? Gilbert

  • #2
    Send Spool File Via TCP/IP

    Gilbert, I understood when CHGVAR VAR(&SPLNBR#) VALUE(&SPLNBR@) the &SPLNBR# is a *DEC. IBM's *SPLF* commands keep SPLNBR as *CHAR 6 Spooled file number . . . . . . ______ 1-9999, *ONLY, *LAST Ira

    Comment


    • #3
      Send Spool File Via TCP/IP

      Another example is the Job Number.

      Comment


      • #4
        Send Spool File Via TCP/IP

        Hi Gilbert, There are other ways, although I don't think it will help you much. Just to make you envious, in the AS400 Toolbox for Java, there's a class called SpooledFileList. This allows me basically to just ask for a list of spooled files and read each item on the list, grabbing the information I need. I've used this to move mountains of spooled files to a PC, in the process doing some manipulation so they will be readable in Word or text editors, then burning them to a CD. I can even read SCS directly ( although I REALLY don't want to. ;-P ) To your problem: Without all of the source, one can never know for sure, but, you're getting the error on RCVF. Aside -- I'm assuming that what you said is what you are getting. As to the other answers regarding char and dec, here's what the CL Programming manual has to say at section 2.4.5 Changing the Value of a Variable: "For a logical variable, the value to which the variable is to be changed must be a logical value. For decimal variables, a decimal or character value can be used. For character variables, either character or decimal values are accepted." -- End Aside This implies to me that you are reading a file at runtime that is different ( in terms of data structure ) than the file used to compile against. In the past, I typically just created a physical file and gave it a length of 133, no DDS. If you use DDS, it should have 1 character field, length 133. Different data types means something like trying to read packed into char, for example. So my advice is to be sure that everything matches: library list, file name, that any overrides are correct, etc. And check your compile listing that file matches for your &OUTQFILE variable. None of the code after RCVF should be relevant to the problem you described. BTW, cool machine, lots of goodies. Have fun with it. Best, Joe Sam Joe Sam Shirah Autumn Software Consulting/Development/Outsourcing Please Note New Email: jshirah@attglobal.net Visit our User Group at: http://www.jax400.com

        Comment


        • #5
          Send Spool File Via TCP/IP

          Hi Gilbert! Okay, first off your problem is not on the RCVF, but on a CHGVAR. CPF0818 is only received for CHGVAR. One way to get CPF0818 to occur is to try to put non-numeric data into a numeric field. The following code:
          0001.00 CHGVAR: PGM 0002.00 DCL VAR(&CHAR8) TYPE(*CHAR) LEN(8) + 0003.00 VALUE('1234XXXX') 0004.00 DCL VAR(&DEC40) TYPE(*DEC) LEN(4 0) 0005.00 0006.00 CHGVAR &DEC40 %SST(&CHAR8 1 4) 0007.00 CHGVAR &DEC40 %SST(&CHAR8 5 4) 0008.00 0009.00 ENDPGM 
          Will get a CPF0818 error on line 7, not on line 6. Line 6 is fine, because the first four characters of &CHAR8 are numeric, but line 7 fails because the second four characters are not numeric. Hope this helps! src="//www.zappie.net/java/_derived/index.htm_cmp_zero110_vbtn_p.gif" width="140" height="60" border="0" alt="Java400.net - Java/400 Freeware" align="middle"> Java400.Net - where the AS/400 speaks Java with an RPG accent Home of PBD2.0, the color=red>FREE Java/400 Client/Server color=blue>Revitalization Toolkit

          Comment

          Working...
          X