× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



James Salter wrote:

>Here is the situation once again:  several of 
>our application printouts that go to our 
>customers use overlays.  To do this with 
>overlays, obviously you need *AFPDS as 
>the device type.  We have a cold storage 
>system that requires us to use spoolfiles 
>with *SCS.  One way of generating this 
>spoolfile is rerunning the nightly robot jobs 
>overriding the device type to *SCS.
>
>This works fine for nightly jobs, however 
>during the day we have some "run only 
>once" jobs that will not allow us to 
>generate a cold storage version of
>the document without some heavy 
>programming.   The cold storage product
>works best when you can do a *FCFC 
>translation on a spoolfile.
>
>I was wanting a somewhat automated way 
>of taking spoolfiles in one outq that are 
>of *AFPDS and doing some type 
>conversion to them to get an *SCS
>equivalent spoolfile.

Thanks for your patience!  I am also looking at QSPGETF but I have not
decoded the format yet, so I can't yet manipulate the contents of the file
to properly do a QSPPUTF.  The other set of APIs that address this stuff are
QSPGETSP et al.  I have just started looking into them and can tell you they
look a bit complex.

A work-around (since you have access to the CL) is to OVRPRTF *PRTF
DEVTYPE(*SCS) before running the "run once" jobs.  Perhaps use a parameter
or entry in a control file to toggle between "print this" and "output to
COLD..."

>If I could monitor this AFPDS outq where 
>all of my AFPDS printouts are routed 
>(or duplicated into) by using dtaq's, 
>you are saying  I could intercept the 
>spoolfile before it gets written and 
>then override the device type at this point?

You can't intercept the spooled file because it's already in the OUTQ.  You
can copy it, hold it, etc. but it is already created and I don't think you
can simply change the attributes via CHGSPLFA.  The Printer Device
Programming book, SC41-5713 has details of this method.  Here's a
boilerplate CL program.  It's so old (1994) that I can't properly attribute
it:

PGM /* Receive DTAQ entry attached to OUTQ */

/* CRTDTAQ DTAQ(BUCK/BUCK) MAXLEN(128) TEXT('Test for OUTQDTAQ') */
/* CHGOUTQ BUCK DTAQ(BUCK/BUCK)                                  */

/* Data queue API parameters */
DCL &DTAQNAM   *CHAR 10  'BUCK'
DCL &DTAQLIB   *CHAR 10  'BUCK'
DCL &DTAQLEN   *DEC (5 0)
DCL &WAITTIM   *DEC (5 0) 0      /* Wait time in seconds   */
                                 /* 0=no wait              */
                                 /* -1=wait forever        */
                                 /* If timeout, &DTAQLEN=0 */
DCL &DTAQDTA   *CHAR 128
DCL &DTAQORD   *CHAR   2 'GE'
DCL &DTAQKEYL  *DEC (3 0) 0
DCL &DTAQKEY   *CHAR   1
DCL &DTAQSNDL  *DEC (3 0) 44     /* Set to 0 if don't want */
                                 /* sender ID information  */
DCL &DTAQSND   *CHAR  44

/* Spooled file information */
DCL &SPLJOBNAM *CHAR 10
DCL &SPLJOBUSR *CHAR 10
DCL &SPLJOBNBR *CHAR  6
DCL &SPLNAM    *CHAR 10
DCL &SPLNBRCHR *CHAR  4
DCL &SPLNBR    *DEC (4 0)
DCL &OUTQNAM   *CHAR 10
DCL &OUTQLIB   *CHAR 10

/* Sender ID information */
DCL &SNDJOBNAM *CHAR 10
DCL &SNDJOBUSR *CHAR 10
DCL &SNDJOBNBR *CHAR  6
DCL &SNDUSR    *CHAR 10
DCL &HEX8F     *CHAR  4 X'0000008F'

/* RTVSPLFA information */
DCL &PAGES   *DEC   (15 0)
DCL &PAGEA   *CHAR    4
DCL &SPLFA   *CHAR 1000
DCL &SPLFAD  *DEC   (9 0) VALUE(1000)
DCL &SPLFAB  *CHAR    4
DCL &USRDTA  *CHAR   10
DCL &QUALJOB *CHAR   26
DCL &INTJOB  *CHAR   16
DCL &INTSPLF *CHAR   16

/* Get the data queue entry */
CALL QRCVDTAQ (&DTAQNAM  +
               &DTAQLIB  +
               &DTAQLEN  +
               &DTAQDTA  +
               &WAITTIM  +
               &DTAQORD  +
               &DTAQKEYL +
               &DTAQKEY  +
               &DTAQSNDL +
               &DTAQSND)

/* No entry was received */
IF (&DTAQLEN=0) (GOTO END)

/* Not a spooled file entry */
IF (%SST(&DTAQDTA 01 06) *NE '*SPOOL') (GOTO END)

/* Convert from single field to actual spool data */
CHGVAR &SPLJOBNAM %SST(&DTAQDTA 13 10)
CHGVAR &SPLJOBUSR %SST(&DTAQDTA 23 10)
CHGVAR &SPLJOBNBR %SST(&DTAQDTA 33 06)
CHGVAR &SPLNAM    %SST(&DTAQDTA 39 10)
CHGVAR &SPLNBRCHR %SST(&DTAQDTA 49 04)
CHGVAR &SPLNBR    %BIN(&SPLNBRCHR)
CHGVAR &OUTQNAM   %SST(&DTAQDTA 53 10)
CHGVAR &OUTQLIB   %SST(&DTAQDTA 63 10)

/* Convert from single field to actual sender data */
/* SENDERID(*NO) */
IF (%SST(&DTAQSND 01 04) *EQ &HEX8F) (GOTO PROCESS)

CHGVAR &SNDJOBNAM %SST(&DTAQSND 09 10)
CHGVAR &SNDJOBUSR %SST(&DTAQSND 19 10)
CHGVAR &SNDJOBNBR %SST(&DTAQSND 29 06)
CHGVAR &SNDUSR    %SST(&DTAQSND 35 10)

PROCESS:    /* Do something with the data */

/* Retrieve USRDTA from spool file attributes */
CHGVAR &QUALJOB (&SPLJOBNAM *CAT &SPLJOBUSR *CAT &SPLJOBNBR)
CHGVAR %BIN(&SPLFAB 1 4) &SPLFAD

/* Get the spooled file attributes */
CALL QUSRSPLA (&SPLFA     +
               &SPLFAB    +
               'SPLA0100' +
               &QUALJOB   +
               &INTJOB    +
               &INTSPLF   +
               &SPLNAM    +
               &SPLNBRCHR)

CHGVAR &USRDTA %SST(&SPLFA 0091 10)
CHGVAR &PAGEA  %SST(&SPLFA 0141 04)
CHGVAR &PAGES  %BIN(&PAGEA)

DMPCLPGM

END:            /* The end */

RCLRSC
ENDPGM

I will post my findings on decoding QSPGETF and also the QSPGETSP API.

Buck Calabro
Aptis; Albany, NY
"We are what we repeatedly do.
 Excellence, then, is not an act, but a habit." --Aristotle


Billing Concepts Corp., a NASDAQ Listed Company, Symbol: BILL
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.