/\ \/
/\ APIs Used: QUSLSPL - List Spooled Files \/
/\ QUSCRTUS - Create User Space \/
/\ QUSPTRUS - Retrieve Pointer to User Space \/
/\ \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
#include <stdio.h>
#include <string.h>
#include <quslspl.h> /\ QUSLSPL API header \/
#include <quscrtus.h> /\ QUSCRTUS API header \/
#include <qusptrus.h> /\ QUSPTRUS API header \/
#include <qusgen.h> /\ Format Structures for User Space .11/ \/
#include <qusec.h> /\ Error Code parameter include for APIs \/
#include <qliept.h> /\ Entry Point Table include for APIs \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Global variables \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
char spc_name[] = "SPCNAME QTEMP ";
int spc_size = 2ððð;
char spc_init = ðxðð;
char \spcptr, \lstptr, \lstptr2;
int pages;
struct keys { int key1; .7/
int key2;
int key3;} keys = {2ð1, 211, 216}; .8/
int number_of_keys = 3;
char ext_attr[] = "QUSLSPL ";
char spc_aut[] = "\ALL ";
char spc_text[] = " ";
char spc_replac[] = "\YES ";
char spc_domain[] = "\USER ";
char format[8] = "SPLFð2ðð"; .4/
char usr_prf[] = "\CURRENT ";
char outq[] = "\ALL ";
char formtyp[] = "\ALL ";
char usrdta[] = "\ALL ";
char jobnam[26] = " ";
char prtfil[];
char opndat[7];
typedef struct {
Qus_LSPL_Key_Info_t Key_Info;
char Data_Field[1ðð];
} var_record_t;
Qus_EC_t error_code;
int i, j;
char prtlin[1ðð];
FILE \record;
main()
{
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
/\ Open print file for report \/
/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/
if((record = fopen("QPRINT", "wb, lrecl=132, type=record")) == NULL)
{ printf("File QPRINT could not be opened\n");
B-34 System API Programming V4R1