Category Archives for "iSeries"

How to ZIP AS400 library and Email it

Now, before you get all bent out of shape and point your grubby little index finger at me cackling “you called it an AS400 na-na-nu-na-naaah“, I do have a legitimate reason. It’s a shallow SEO based one (the grey haired brigade keep searching for “zip AS400 library”) but it’s legitimate. I only used the wrong […]

Continue reading

Update an IBM i file with SQL cursor using SQLRPGLE WHERE CURRENT OF

Using SQL in RPGLE programs is easier than you think. Making the move from RPG native file IO to SQL database IO is really quite straightforward.  Changing from good old READE loops to SQL FOR Loops simply means using the SQL CURSOR function. SQL has a groovy way of referring to what the stuff that […]

Continue reading

Green Screen to Web Application in 5 minutes (aka how the AS400 got on the World Wide Web with IBM i)

Twenty years ago… I was typing on a dumb terminal, connected to a great big beige computer called IBM AS/400 with a thick grey Twinax cable. Screens were green on black, text only — or sometimes orange on black if you were posh. The internet was this thing we used to send emails (if you knew […]

Continue reading

RPG Program Source Code – Clever or Clear?

I’ve been working on an interesting project focused on taking some old RPG code and re-factoring it to make it more efficient. Fascinating work for a client that is focused on doubling its IBM i throughput and reducing the CPU load of all its old programs. This has frequently made me choose between writing a […]

Continue reading

GETSPLF and PUTSPLF – read and write spools to physical files including all Advanced Function Printing Data Stream (AFPDS)

wow – that has got to be the longest url yet   😉

 

QSPGETF AND QSPPUTF APIs AND COMMANDS

IBM Knowledgebase item 8011926 describes two APIs that are undocumented in the AS/400 manuals. The two APIs, Get Spooled File (QSPGETF) and Put Spooled File (QSPPUTF), copy spool files to and restore them from physical files, respectively. The advantage of QSPGETF and QSPPUTF over the well-documented Copy Spooled File command (CPYSPLF) is that the APIs are able to copy Advanced Function Printing Data Stream (AFPDS) and Intelligent Printer Data Stream (IPDS) spool files, whereas CPYSPLF cannot.

You can call the QSPGETF and QSPPUTF APIs directly, or you can call them using command wrappers over the APIs.

  • Calling the APIs Directly

The QSPGETF API call below saves spool file QPRINT to database file SPOOLDB in USER1LIB library, member MBR1, where the spool file number is 1 and the spool file job is 010160/user1/dsp03:

CALL PGM(QSYS/QSPGETF) PARM(‘QPRINT ‘ ‘SPOOLDB USER1LIB ‘ ‘DSP03 USER1 010160′ X’0001’ ‘MBR1 ‘)

Continue reading

Give AS400 users the ability to change user authority temporarily

More questions about adopting authority on IBM i Systems and a technique to change user authority temporarily. So lets #discuss 😉 Adopt higher IBM i Authority to change System Configuration Question: I am needing to write a program, command, or whatever, that will enable my users to adopt a higher authority when they want to […]

Continue reading
1 2 3 15