× 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.



--
[ Picked text/plain from multipart/alternative ]
Amitiva wrote:

Hello Group
I am writing a program in ASSET. User will enter a Customer number range. The
program will create separate spool (report) for each customer. I mean, if
there is 5 customer numbers in the range entered, program will create 5
reports. For that, I need to declare the Printer file as 'User Controlled'
and when there will be a change in customer number I will close and reopen
the printer
file so that it creats different spool. I know I can do it in RPG.

But my problem is ASSET does not allow to use OPEN and CLOSE statements for
printer and display file. So how can I do that in ASSET?
TIA
Amitava
******************************************************************************

********************

Hi Amitava,

     ASSET does provide for this but as you state, you cannot do it simply by
using the OPEN and CLOSE command as you can with physical and logical files.

     You must create source subroutines for both the open and close
statements as follows:

Act Subroutine   Subroutine                     Source     Library    Member

    Name/ Type   Description                    File Name  Name       Name



   TCKNPC     S Close Printer File             QRPGSRC    RMSSRCSUB  TCKNPC
   TCKNPO     S Open Printer File              QRPGSRC    RMSSRCSUB  TCKNPO

Using SEU, create the source subroutines as follows:
   1.00      C           TCKNPC    BEGSR
   2.00      C                     CLOSETCKNPIO2
   3.00      C                     ENDSR

   1.00      C           TCKNPO    BEGSR
   2.00      C                     OPEN TCKNPIO2
   3.00      C                     ENDSR

In the AS/SET program, call these subroutines to open and close the printer
files.

Please let me know if you have any other questions.

NOTE: You can use OVRPRTF to add USRDTA parameter to display useful
information for each spool file that can be viewed on the list screen of
WRKSPLF.  That requires building the OVRPRTF statement in a variable and then
calling 'QCMDEXC'.

1) Create a variable (I called it OVRDBF) with a length large enough to hold
entire string.
2) Concatenate the string so that it creates a CL Command for the OVRDBF you
want to use. (Use %BCT ASSET function).
3) Get the length of the CL command string you created and put that value in
a field defined 15,5 Packed (field CALLEN in this example).
CALLEN      %LEN(CPYSPL)
4) Call the QCMDEXC command with the 2 variables below.
CALL        'QCMDEXC',OVRDBF,CALLEN

Let me know if you have questions.

Regards,
Andy


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.