You are here: Available Utilities > A > AFPRESRC

AFPRESRC

Use this utility to determine the AFP resources used by an AFP print stream. You can also use this utility to combine an original AFP print stream along with its required AFP resources into a new AFP print stream.

The types of AFP resource files supported by this utility are:

Program names

Syntax

AFPRESRC /I /O /F /L /RESDIR

Note If you are running on z/OS, see AFPRESRC z/OS Considerations regarding these parameters.

Parameter

Description

/I

Enter the name of the input AFP print file.

/O

(Optional) Enter the name you want assigned to the output AFP print file which includes the added resource files.

/F

(Optional) Enter the name of the Formdef file you want to add to the output file.

/L

(Optional) Enter the name of the listing file that contains the names of resource files which will be used.

/RESDIR

(Optional) Enter the name of the directory that contains the AFP resource files. The default is the directory of the input AFP print file.

Be sure to produce a listing file before you create a new AFP print stream. This will help you determine what AFP resource files you will need to have available.

The lines of the listing file will be in the following comma-delimited format:

FileName,AFP,Type

Element

Description

FileName

This is the name of the resource file.

AFP

This indicates the file is an AFP resource.

Type

This tells you what type of AFP resource it is, such as FDF, OVL, PSG, CFF, CSF, or CPF.

Notes

AFP Resource Files

If the AFP print stream contains AFP overlays or AFP coded font references, the AFPRESRC utility opens these files to look for the other resource files used by these files. Here is a list of the types of AFP resource files the utility supports and the file extensions it uses when it searches for these files.

AFP resources

Type

File extensions searched

AFP formdef

FDF

“.fdf”, “.”

AFP overlay

OVL

“.ovl”, “.oly”, “.”

AFP page segment

PSG

“.psg”, “.seg”, “.”

AFP coded font

CFF

“.”, “.fnt” “.cff”

AFP character set

CSF

“.”, “.240”, “.300”, “.fnt”, “.csf”

AFP code page

CPF

“.”, “.fnt”, “.cpf”

The utility looks for the AFP resource files in the directory you specify in the RESDIR parameter. If you omit the RESDIR parameter, the utility looks for the AFP resource files in the directory in which the input AFP print stream is located.

Here are a couple of examples:

Scenario 1

Assume you want to identify the AFP resource files are used by an AFP print stream, perhaps because you want to convert the AFP print stream into a FAP file. Assume you have an AFP print stream named scenario1.afp. To produce a list of the AFP resources used in scenario1.afp, use this command:

AFPRESRC /I=scenario1.afp /L=list.txt

This command produces a text file named list.txt. This text file contains a list of the AFP resource files used by the AFP print stream, scenario1.afp. The text file would look similar to this one:

Q1ADDR,AFP,OVL

Q1B302,AFP,OVL

Q1BA32,AFP,OVL

Q1BA36,AFP,OVL

Q1BILL,AFP,OVL

Q1DLOG,AFP,PSG

QCBUL,AFP,PSG

QJANED,AFP,PSG

QJOHND,AFP,PSG

X0DACON0,AFP,CFF

X0DACON6,AFP,CFF

X0DACON8,AFP,CFF

X0DACONB,AFP,CFF

X0DATIBF,AFP,CFF

C0FACON0,AFP,CSF

C0FACON6,AFP,CSF

C0FACON8,AFP,CSF

C0FACONB,AFP,CSF

C0FATIBF,AFP,CSF

T1DOC037,AFP,CPF

Scenario 2

Assume you want to take the AFP print stream mentioned in Scenario 1 and print it on an AFP printer that does not have the necessary AFP resource files. To produce an AFP print stream that contains the original AFP print stream (scenario1.afp) plus all of the AFP resources used in scenario1.afp, you would use this command:

AFPRESRC /I=scenario1.afp /L=list.txt /O=NewFile.afp /RESDIR=c:\AFPFiles

This command produces an AFP print stream named NewFile.afp. This print stream contains the original AFP print stream (scenario1.afp) plus all of the AFP resources used in scenario1.afp. For this scenario, the AFP resource files must be in the c:\AFPFiles directory, as specified in the /RESDIR parameter.

This scenario also produces a text file called list.txt which contains a list of the AFP resources files used by the AFP print stream, scenario1.afp. You could have omitted the /L parameter if do not want a listing of the AFP resource files.

Note The command used in scenario 2 does not include the /F file parameter, so no formdef file is embedded in the new AFP print stream (NewFile.afp). As a result, you would need to specify a formdef file when you print the AFP print stream.

Sample JCL for printing the AFP OUTPUT FILE

Here is an example of the JCL you could use to print the AFP print stream using a formdef file named F1FMMST.

//OUT1 OUTPUT FORMDEF=FMMST,

// USERLIB=(FSI.V114.RPEX1.FDEFLIB)

//*

//PRINT EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN=FSI.AFP.PRINT,DISP=SHR

//SYSUT2 DD SYSOUT=2,OUTPUT=*.OUT1

//SYSIN DD DUMMY

If you use the /F parameter to specify a formdef file to be embedded in the new AFP print stream, you can simplify the first two lines of the JCL as shown here:

//OUT1 OUTPUT

//*

//PRINT EXEC PGM=IEBGENER

//SYSPRINT DD SYSOUT=*

//SYSUT1 DD DSN= FSI.AFP.PRINT,DISP=SHR

//SYSUT2 DD SYSOUT=2,OUTPUT=*.OUT1

//SYSIN DD DUMMY

Run-time messages

The AFPRESRC utility displays information as it runs. For example, when producing a listing file as described in Scenario 1, the AFPRESRC utility would display this information:

C:\>afpresrc /i=scenario1.met /l=list.txt

--- AFPRESRC Copyright (C) 1997, 2009 Oracle. All rights reserved.

Informational in AFPRESRC: Creating listing file: list.txt

Informational in AFPRESRC: Finished Successfully

If the AFPRESRC utility cannot find references to AFP resource files in an AFP print stream, it usually means you omitted the /RESDIR parameter which tells the utility where to find the AFP resource files. If this occurs, you see messages similar to these:

C:\>afpresrc /i=Example1.met /l=list.txt

--- AFPRESRC Copyright (C) 1997, 2009 Oracle. All rights reserved.

Informational in AFPRESRC: Creating listing file: list.txt

Informational in AFPRESRC: Cannot find overlay Q1ADDR. in ;

Informational in AFPRESRC: Cannot find coded font X0DACON0.cff in ;

If you were producing a new AFP print stream containing AFP resource files as described in Scenario 2, you could see many more messages for missing page segments and AFP font files. The AFPRESRC utility displays information about each AFP resource file that is being embedded into the new AFP print stream. In this case, the messages from AFPRESRC could look something like this:

C:\>afpresrc /i=Example1.met /l=list.txt /resdir=fonts

--- AFPRESRC Copyright (C) 1997, 2009 Oracle. All rights reserved.

Informational in AFPRESRC: Creating listing file: list.txt

Informational in AFPRESRC: Cannot find character set file C2N20000 in ;

Informational in AFPRESRC: Cannot find character set file C4T05500 in ;

Informational in AFPRESRC: Cannot find code page file T1GI0395 in ;

Informational in AFPRESRC: Cannot find code page file T1V10500 in ;

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

* UTLDefErrorExit

* ..\C\afpresrc.c

Sep 18 2008 16:01:03

400.114.000

AFPRESRC <0> <0> ERROR --> 4 font files could not be downloaded

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

 

Informational in AFPRESRC: Finished with Errors

In this example, there were two AFP character set files (C2N20000 and C4T05500) and two AFP code page files (T1GI0395 and T1V10500) that were not found in the directory specified by the /RESDIR parameter.

Error messages

Here are some error messages you can see when producing a new AFP output file such as described in Scenario 2:

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

AFPRESRC <0> <0> ERROR --> Example1.afp is a corrupt file or not an AFP file

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

This error tells you the AFPRESRC utility does not recognize the input AFP print stream as a valid AFP file.

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

AFPRESRC <0> <0> ERROR --> Unable to recognize record 1

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

This error tells you the AFPRESRC utility does not recognize the AFP record format of the input AFP print stream. The AFPRESRC utility supports AFP print files written using native record format and Documerge variable block format.

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

AFPRESRC <0> <0> ERROR --> Cannot open output file NewFile.afp

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

This error tells you the output file cannot be created. One possibility is that the output file already exists as a read-only file. On a mainframe, the output file needs to be deleted in the JCL used to run AFPRESRC.

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

AFPRESRC <0> <0> ERROR --> Error trying to write ##### bytes

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

or

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

AFPRESRC <0> <0> ERROR --> Cannot write to output file NewFile.afp

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

This error could mean that you ran out of disk space while producing the new AFP print file. On a mainframe, this error might tell you that you did not allocate enough space for the new AFP file or the logical record length (LRECL) is not big enough. You can also tell that the DD:OUTFILE ran out of space because of the B37 abend message in the JES job log. Any kind of x37 message, such as B37, D37, or E37, indicates an out-of-space condition.

Using the trace file

Because there can be a large number of AFP resource files used in an AFP print stream, these messages are written to a trace file in addition to being displayed on the console. The trace file is overwritten each time you run the AFPRESRC utility. If you want to keep the results from a run, you must rename the trace file so that is not overwritten.