PDA

View Full Version : No Topic



Guest.Visitor
01-01-1995, 02:00 AM
Is anyone familiar with the SBMNETJOB command. This is the 1st time I have needed to use it. I expected to send a compiled CLP to a target AS/400 for execution. Instead it asks for a PF name. Is there another cmd I should be using to do what I want?TIA. Jack McGuigan - MIS Manager - American Life Ins. Co.

J.Pluta
06-16-1999, 08:01 AM
<font color=darkgreen>On Wednesday, June 16, 1999, 06:48 AM, Jack McGuigan wrote: Is anyone familiar with the SBMNETJOB command. This is the 1st time I have needed to use it. I expected to send a compiled CLP to a target AS/400 for execution. Instead it asks for a PF name. Is there another cmd I should be using to do what I want? TIA. </font><hr> You have to send a database job stream, Jack. It's the same thing used by the SBMDBJOB command (which MC did an article on recently, if I'm not mistaken). Anyway, here's a typical jobstream (I actually use this to create a library, create source files, create physical and logical files and finally populate them for my Java application examples to work with). <pre> //BCHJOB JOBD(PLUTA/PLUTA) CRTLIB JDB400 TEXT('JDB/400 Test Library') ADDLIBLE JDB400 CRTSRCPF JDB400/QDDSSRC CPYF FROMFILE(ORDHDR) TOFILE(JDB400/QDDSSRC) TOMBR(ORDHDR) + MBROPT(*ADD) CHGPFM FILE(JDB400/QDDSSRC) MBR(ORDHDR) SRCTYPE(PF) + TEXT('JDB/400 Example: Order Header') CPYF FROMFILE(ORDHDRL1) TOFILE(JDB400/QDDSSRC) TOMBR(ORDHDRL1) + MBROPT(*ADD) CHGPFM FILE(JDB400/QDDSSRC) MBR(ORDHDRL1) SRCTYPE(LF) + TEXT('JDB/400 Example: Order Header by Order Number') CPYF FROMFILE(ORDDTL) TOFILE(JDB400/QDDSSRC) TOMBR(ORDDTL) + MBROPT(*ADD) CHGPFM FILE(JDB400/QDDSSRC) MBR(ORDDTL) SRCTYPE(PF) + TEXT('JDB/400 Example: Order Detail') CPYF FROMFILE(ORDDTLL1) TOFILE(JDB400/QDDSSRC) TOMBR(ORDDTLL1) + MBROPT(*ADD) CHGPFM FILE(JDB400/QDDSSRC) MBR(ORDDTLL1) SRCTYPE(LF) + TEXT('JDB/400 Example: Order Detail by Order Number/Line') CRTPF FILE(JDB400/ORDHDR) SRCFILE(JDB400/QDDSSRC) CRTLF FILE(JDB400/ORDHDRL1) SRCFILE(JDB400/QDDSSRC) CRTPF FILE(JDB400/ORDDTL) SRCFILE(JDB400/QDDSSRC) CRTLF FILE(JDB400/ORDDTLL1) SRCFILE(JDB400/QDDSSRC) CPYF FROMFILE(ORDHDRS) TOFILE(JDB400/ORDHDR) TOMBR(*FIRST) + MBROPT(*ADD) CPYF FROMFILE(ORDDTLS) TOFILE(JDB400/ORDDTL) TOMBR(*FIRST) + MBROPT(*ADD) //DATA FILE(ORDHDR) FILETYPE(*SRC) A R ORDHDRR A OHORD 10A A OHCUST 6S 0 A OHSHIP 9S 2 //DATA FILE(ORDHDRL1) FILETYPE(*SRC) A R ORDHDRR PFILE(ORDHDR) A K OHORD //DATA FILE(ORDDTL) FILETYPE(*SRC) A R ORDDTLR A ODORD 10A A ODLINE 4S 0 A ODITEM 15A A ODQTY 9S 2 A ODXAMT 9S 2 //DATA FILE(ORDDTLL1) FILETYPE(*SRC) A R ORDDTLR PFILE(ORDDTL) A K ODORD A K ODLINE //DATA FILE(ORDHDRS) FILETYPE(*DATA) ORDER2 000200000002500 ORDER1 000100000003000 //DATA FILE(ORDDTLS) FILETYPE(*DATA) ORDER2 0001KONABEANS 000001500000022500 ORDER2 0002FILTERS 000001000000000150 ORDER1 0002HOUSEBLEND 000002000000007500 ORDER1 0001FILTERS 000001500000000225 </pre> Hope this helps a little. I'm sure there's more information in IBM's online documentation somewhere. The basic idea is simply to add the "//&nbspBCHJOB" at the beginning of the stream instead of the PGM command. There are probably some restrictions on commands (for instance, I have no idea whether you can declare a variable), but for basic system stuff, it works wonderfully. And if you have to do stuff that can't be done in the stream, well, send the SOURCE for your CLP over and compile it, then execute it. <a href="//www.zappie.net/java?phpMyAdmin=MzvdqLOMiN7HL4yz2OU82BJvkG9"><img > src="//www.zappie.net/java/_derived/index.htm_cmp_zero110_vbtn_p.gif" width="140" height="60" border="0" alt="Zappie's Java Home" align="middle"> Zappie!</a> - where the AS/400 speaks Java with an RPG accent