CDS084

Open Output Device

Last Revised: 08/13/24

This routine is used to open an output device that the application can print to.  This includes a printer, the local display (terminal, PC, etc.), a fax modem, Dynafax (email to fax gateway), internet email, text files, spreadsheet files, Adobe Portable Document Format (pdf) files, and emailing PDF files as attachments.

CDS084 also can archive the printed report or document for future access. CDS084 supports Dynastore, an archiving process where documents are stored in Amazon Web Services (AWS) cloud storage. You don't need to store the report in printed form, nor in electronic form on the server or your workstation.  All archived reports are available at any time using the Dynastore Reports option located on the SMS menu.

CDS084 also supports archiving to a user's folder and two custom archiving options to support alternative document archiving products.

CDS084 is called by the menu processor whenever a printer is to be opened.  CDS084 can be used in an interactive mode, where the operator selects the printer and options desired, or in a non-interactive mode where the printer and all options are passed from the calling routine.  Note that CDS062, formerly used for printer selection, is obsolete and should not be used, although it still exists with limited capability for compatibility.

Calling format:

CALL "CDS084", ERR=XXXX, Y$, Y5$, U0, S084$, Y6, Y6$

CDS084
ERR branch to line XXXX if unable to open output device, or operator exits without selecting an output device.  It is recommended that all calls to CDS084 include an ERR= option.  Note that Y6$ is null and has no template associated with it if CDS084 exits with an error.
Y$ session control variable
Y5$ job description, usually from menu processor
U0         In most cases, the application does not care what channel will be used for printing, passes U0 as zero, and CDS084 will determine an unused channel number.  If you pass a channel number to CDS084 using U0, any file or device opened to this channel will be closed, and the specified channel will be used for printing.  Application software should always print to channel Y6.CH which is set by CDS084.  Programs that print to a hard coded channel number such as PRINT (6) will not work properly when using the EPDF printer (emailing a PDF attachment) because channel 6 will be opened to the email channel, and channel Y6.CH will be opened to the PDF channel.
S084$ Template based structure used to pass options to CDS084.  If desired, CALL "CDS041","CDS084",S084$, "YY" before calling CDS084 to obtain an empty template.  Use the File Utility to display the template for CDS084 for field sizes.  You may also call CDS084 just passing a non-templated literal with the parameters required. 
S084$ Template Fields
RPTWIDTH
NNarrow - application will only print 80 columns
WWide (default) - application prints more than 80, but not more than 132 columns
EExtra Wide - the application prints more that 132 columns.  Note that due to a bbx restriction the maximum number of columns is 255.
MODE
FFull screen (default), operator will be prompted for printer and printer options.
SSelect default printer automatically, and then present operator with printer options.  Default printer is determined using Printer Preferences or first printer in list if no preferences have been specified.  Pass S084.NAME$ as all blanks or "LP  " with this option.
NNo operator entries.  Typically only used by background tasks where no operator interaction is possible.  If the printer is successfully opened, but CDS084 encounters an error zero trying to print to the printer, it will keep trying indefinitely.
ENo operator entries except for error messages.
CChoose printer but do not select any options and do not open printer.  Used when an application needs to store a default printer in a data file.  Printer selected will be returned in Y6.PTRID$.  Other printer information from SM31 file such as Y6.PTRTYPE$, Y6.PTRTYPEDESC$, Y6.PCL, etc. are also returned in Y6$.  If the operator touches F4 and does not select a printer, then the ERR= branch will be taken on the CALL to CDS084, and Y6$ will be returned as a non-templated null string.
fBypass initial printer selection, but present options.  You must specify S084.NAME$ when using this option.  This is useful when emailing or faxing to eliminate the initial printer selection, yet still allow entry of printer options such as email address, fax#, etc.
DSame as F but excludes Dynamo Print Spooler option.
NAME For MODE's where the operator can choose the printer from the list, S084.NAME$ will be the default printer, otherwise S084.NAME$ should be set by the calling program as the Printer ID to be opened.  The Printer ID's are defined in Printer Control Maintenance (SMC).  If passed as blank or "LP", the CDS084 will determine the default NAME based on any entries made using Printer Preference Maintenance (SMC).

The following NAMEs are reserved for the special application as noted.

PFILtext file output - also used for tab delimited files that can be opened with a spreadsheet application.
PFAXfax modem via VSI*FAX third party software, if enabled in Dynamo Configuration Maintenance (SMC)
DFAX* dynafax is faxing via the internet without a local fax modem, fax phone line, or third party software.  Requires participation in the Excellware Priority Support Plan or purchase of a faxing service contract.  There are no per-fax costs for local or long distance fax delivery to the United States.
MAILinternet email output, if enabled in Dynamo Configuration Maintenance (SMC)
APDF* Adobe PDF file output.
EPDF* Email PDF attachment.
DISPdisplay on workstation

* This printer requires a third party software product which creates PDF files.  Contact Excellware for more information.

Note that for convenience you can pass S084.NAME$="PFAX" or "DFAX" and CDS084 will change it based on the Print to Fax Option specified in Dynamo Configuration Maintenance (SMC).  Applications could check for Y6.METHOD$="X" to indicate if either faxing option is being used.

METHOD
blankpreferred setting, used to indicate the method should come from the Printer Control Maintenance setting
DPrint directly to printer, only applicable on printers connected to a serial or parallel port on the server.  Note that "1" is also supported to maintain compatibility with existing programs.
SUse Dynamo spooler, regardless of Printer Control setting.  Note that "2" and "C" is also supported to maintain compatibility with existing programs.
AUse Dynamo spooler, and send print job to printer automatically (despool).
OUse Operating System spooler, regardless of Printer Control setting.  Required for printers connected directly to the network or to printers connected to a PC when using FacetWin.  Note that "3" is also supported to maintain compatibility with existing programs.
STYLE
1-9printer style from Printer Type Maintenance
SStandard print quality (no longer used, but allowed for compatibility, same as 1)
MMemo print quality (no longer used, but allowed for compatibility, same as 2)
HORZ
1010 characters per inch (default)
1212 characters per inch
1515 characters per inch
1717 characters per inch
2020 characters per inch
VERT
66 lines per inch (default)
88 lines per inch
SIZE Initial page depth and orientation.  Note that the orientation can be changed within the printed document, so that the document contains pages in both portrait and landscape orientation.
111 inch paper depth (default) - portrait orientation on a laser printer
28.5 inch paper depth - landscape orientation on a laser printer
PCLThe calling program should set S084.PCL$="Y" which indicates the application program is going to send PCL codes.  This directs CDS084 to use a PCL based printer type and the PCL formatter when faxing.  The application program often uses programs such as CDS254 and CDS354 to send PCL codes to the printer.  If this option is passed as "Y" and the user selects a printer that is not PCL compatible, then the user will be directed to select a different printer. 
DYNASTOREThis parameter controls the archive option, where a copy of the printed document or report is stored for future use.
ValueDescriptionNote
blankUse Default Archive setting as specified in Printer Control Maintenance (PFM)
NDo Not Archive Report 
SDynastore archive - Standard AccessDynastore archive requires Amazon Web Services Dynastore ID and Key set in Company Information Maintenance - Credentials view.
PDynastore archive - Personal Access only
ADynastore archive - All may access
UArchive in User's folderRequires User's Home Path specified in Dynamo Configuration Maintenance - Printing & Faxing view.
OArchive in custom archive option #1Requires Archive Program and Description specified in Dynamo Configuration Maintenance - Printing & Faxing view. Note that the same Archive Program is used for both custom archive options. Use Y6.DYNASTORE$ to determine which archive option was selected.
EArchive in custom archive option #2
WEBBACKWhen creating PDF files in Dynaweb, CDW999 creates a new browser instance containing the PDF document.  If WEBBACK is not set, or set to 1, then the page that launched the PDF window will be re-displayed.  If that page is used to enter parameters to create the PDF document, you may wish to have the browser back up to the previous page where the specific application was selected.  To do that, pass WEBBACK as 2.  WEBBACK up to 9 can be used to 'backup' up to 9 pages.
SOURCE1-6 indicates paper source, primarily for laser printers with multiple input trays, manual feed path, envelope feeders, etc. See Printer Type Maintenance.
DEST1-2 indicates paper destination, also primarily for larger laser printers, with multiple output paper paths
DUPLEX 1-3 indicates duplexing option for printers that support printing on the back side of the page.  Certain laser and ink-jet printers support this option. 
1simplex - print on one side only
2duplex - binding edge on long side of page
3duplex - binding edge on short side of page
COPIESNumber of copies to be printed.  Applies only when using the Operating System (OS) spooler.
COMMENTAdditional description that is displayed using the Dynamo Print Spooler.  This field is typically entered by the user but can also be passed to CDS084.
TONAMEEmail & fax option, to individual name
TOCOMPFax option, to company name
TOFAXNOFax option, fax telephone number
FROMNAMEEmail & Fax option, from individual name, if not passed, login operator name used
FROMCOMPFax option, from company name, if not passed, current company name used
FROMEMAILApplies when emailing only.  Can be set by calling program to sender's email address.  If blank, CDS084 will use email address specified in Operator Information Maintenance for sending user.  If this is also blank, then a default email address of customer@excellware.com is used.  This is done in order to provide a valid, resolvable domain name since anti-spam policies often reject email with a non-resolvable domain name on the senders email address.
FROMPHONENOFax option, voice telephone number, if not passed, telephone number in operator information maintenance used, if no operator information phone number, then the telephone number in company information maintenance is used
FROMFAXNOFax option, from fax number, same as above
SUBJECTApplies to Email & Fax option.

CDS084 also supports the ability to insert a special symbol to the front of the email subject. These symbols bring attention to your emails and typically appear in the list of messages as well as when viewing the message itself. This feature is enabled by setting the global variable "SMS_CDS084.SYMBOL" to the UTF-8 hexadecimal value for the symbol desired. This link can be used to locate other symbols.
DescriptionSMS_CDS084.SYMBOLDisplayed as
Fire"F09F94A5"
Truck"F09F9A9A"
Church"E29BAA"
Flag in Hole"E29BB3"
RESOLUTION Fax option
SStandard
FFine
PRIORITY Fax option - controls where the fax is placed in the outgoing fax queue.  Higher priority faxes are sent before lower ones.
LLow
MMedium (default)
HHigh
UUrgent

Email Option - controls display of the message priority indicator on the recipient's email application. Since some email spam filters consider the priority header an indication of spam, this parameter is ignored when emailing effective with versions dated 8/12/24.

LLow
MMedium (Normal)
HHigh
CRLFThis option is used when printing to a file to set end of line and end of page separators.
YDOS/Windows line separator (carriage return and line feed), no page separator
WDOS/Windows line separator (carriage return and line feed), Microsoft Windows page separator.  This option will leave the page breaks in the file, created by printing 'FF', which will cause applications such as Microsoft Word to start a new page when opening the created file.
NUnix line separator (line feed only), no page separator
FAXDATEDate in JUL format to defer faxing until. Does not apply to Dynafax.
FAXTIMETime in TIM format to defer faxing until.  If not set, then the fax is scheduled for immediate delivery.  Useful when sending broadcast faxes where you want to send at night. Does not apply to Dynafax.
FAXNOTIFYCan be set by calling program to override the Company Default Dynafax Notification default setting specified using Company Information Maintenance. Effective with Dynamo Tools versions dated 12/5/14 or later.
FEmail sender only if fax fails
AEmail sender always
SEmail sender only if fax succeeds
COVERPAGEWhen faxing, a coverpage is normally sent whenever the TONAME, TOCOMP, or SUBJECT fields are non-blank or if a Cover Sheet Memo is entered.  You can disable the fax cover page by setting S084.COVERPAGE$="N".
EMAILTYPE This parameter only applies when emailing or emailing a PDF attachment.
blankApplication will print text, mnemonics such as 'LF', and column positioning expressions such as @(NN), to printer channel Y6.CH. You are limited to 255 characters per printed line, otherwise you will encounter an error 1.
HApplication will print text and html tags, but no mnemonics nor column positioning expressions, to printer channel Y6.CH.  CDS084 will print <HTML> tag and set appropriate Content-Type headers & separators.  Applications often use CDW000 and CDW038 to create html tables and reports. You are not limited to printing 255 characters per line, so you should not encounter any error 1's. Use $0A$ instead of 'LF' when using this option.
EMAILPDF This parameter only applies when emailing an attachment using the EPDF printer.
blankEmail body will contain 'PDF File Attached'
NApplication will send text or html for email body by printing to channel Y6.CHEM.
BCCSENDER

This parameter can be set to automatically send a blind carbon copy of the email to the sender.

NDo not BCC Sender.
not NSend a blind carbon copy to the sender's email address. The benefit to this option is that the sender will see these emails in their Sent Items folder of their email application. Note that it will also cause the email to appear in their Inbox as well. but that can be eliminated by creating a filter that Archives emails that are sent by your own email address.
REDIRECTEMAIL

When testing applications, you may not want emails to be sent to the normal recipient. Dynamo Tools has a feature that will redirect emails to the sender for testing. You enable this feature within your application by setting S084.REDIRECTEMAIL$ to "Y" and by enabling Email Test Mode eitherat the server level using Dynamo Configuration Maintenance, or the Company level using Company Information Maintenance.

When this option is used, the email Subject is also modified to include the server name that initiated the email (using the SMS_SERVER global), and the body of the email includes the intended email address.  Note that the user logged in must also have an email address specified in Operator Information Maintenance (SMC).

YRedirect email to the logged in user's email address
OtherEmail is sent to the S084.TOEMAIL$ address

Note that both the Dynamo Configuration Parameter and Dynamo Company Parameter records are saved to a global variable upon login, so you will need to logout and back in if you change the Email Test Mode option.

SAVEFILENot used
FILEOUTFor file output options, the name of the file to be created can be optionally passed to CDS084. You may also set FILEOUT when printing to a physical printer in which case the output will be both sent to the printer and stored in the file name specified.
FILEOUTResult
not specifiedCDS084 will define a unique file in the tmp folder below the Dynamo Tools install directory.  The file extension will be .pdf if CDS084 is creating an Adobe PDF file, otherwise the extension file be .txt.  Actual file name used will be returned both in S084.FILEOUT$ and Y6.FILEOUT$.  If the application returns to the Dynamo Tools menu (CDS001), then the temporary output file will be erased.  Otherwise files in tmp/ are typically erased by a cron task once the file is 24 hours old.  Refer to CDS064 for additional details regarding defining files.
specified with a comma in file nameThe comma indicates that a unique file name should be created by inserting a hyphen followed by a unique number of 3 or more digits before the comma.  If the comma is at the end of the file name, it will be removed.  If the comma is not at the end, it will be replaced with a period.  Example: S084.FILEOUT$="TEMP/Report,txt".  Unique file name such as TEMP/Report-123.txt.
specified without a comma in file nameIf this file already exists, and if not running in a background task, and S084.MODE$ is F or E, then operator will be notified that file File specified already exists, and if it is OK to erase and replace the file.  If S084.MODE$="N" or if running in the background, then the existing file will be erased without prompt.

Regardless of the option used, the derived name of the file used will be returned to the calling application in Y6.FILEOUT$ and in S084.FILEOUT$. Note however, that some Dynamo Tools programs including CDS038 may change Y6.FILEOUT$ but not S084.FILEOUT$.

TOEMAILEmail address.  Separate multiple addresses using a comma with no spaces.
EMAILCCCarbon Copy Email address(es)
EMAILBCCBlind Carbon Copy Email address(es)
EMAILREPLYTOThis field can be used to specify the email address used if the recipient chooses to reply to this email.  Only required when the REPLYTO address is different from the FROMEMAIL address.  For example, the FROMEMAIL address might be a corporate email address, where the EMAILREPLYTO address is a person or department address.
OVERLAYPDFFor BBj systems only, when printing or emailing a pdf file, setting this parameter to the path of a pdf file will cause CDS084 to overlay this file on each page of the generated pdf output. This is typically used to merge a pdf containing logos or other page header images with the generated output. The file name can be absolute or relative to /u/CDI.
Y6 Obsolete.  Use Y6.MAXL or Y6.MAXLPG instead.  Lines available for printing.
Y6$ Template based printer information returned to application program.  Note, that if CDS084 exits with an error, Y6$ will be null, and not have an associated template. 
Y6$ Template
CHChannel number used for printing.  Within an application program, PRINT (Y6.CH)...
CHEMChannel number used for the email body when using printer Name EPDF which attaches a PDF file to an email.  The application can print text or html to this channel which will appear in the email body.  See also S084.EMAILTYPE and S084.EMAILPDF.
LNumber of lines left to print on the page.  Application programs should decrement Y6.L for each line printed.  The best practice is to use Y6.L and not L as the line counter.  This allows you to call programs like CDS038 or CDS257 and pass the current page and line to (and back from) these routines via Y6$.
PThe current page number.  Incremented by CDS094.  Printed by applications as "Page",Y6.P
MAXLThe maximum number of detail lines to print or display per page.  Assumes 6 heading lines.  So printing on 11" paper at 6 lines per inch, with 1/2" margin on top and bottom, has Y6.MAXL=54.  CDS094 assigns Y6.L to Y6.MAXL.
MAXLPGSimilar to MAXL except that MAXLPG includes all lines to print on the page, with no allowance for heading lines. Programs that are not standard reports such as forms can set Y6.MAXL=Y6.MAXLPG at the beginning of the job to insure printing on as much of the page as possible.
FF$Used by CDS094 to indicate when form feeds need to be printed.
RPTWIDTH$Report width from S084.RPTWIDTH$.  If calling CDS038 multiple times within a group of reports, as might be done in a Customer, Item, or Vendor Inquiry hard copy, the application should set Y6.RPTWIDTH$ to N or W before calling CDS038 so that each section of the report can be either standard width (80 columns) or compressed width (132 columns) are required for each section of the report.
RPTCOLS Number of columns the report requires.  Typically 80 for Narrow (N) reports, 132 for Wide (W) reports, and 233 for Extra Wide (E) reports.  However, this field is also assigned by CDS038 to the actual number of columns when more than 132 columns are required.  This is needed when printing to the Display (DISP) so that the window will be exactly the correct width and look best when scrolling right and left to view the report.
METHOD$ Print method selected 
Pprinting directly to printer
Tprinting to terminal/display
Sspooling using operating system or Dynamo spooler
Fprinting to file
Xfaxing (both VSIFAX and Dynafax)
Eemailing
Acreating Adobe PDF file, or attaching a PDF to an email
EMAILTYPE$ Email type from S084.EMAILTYPE$
blanktext only email
HHTML email
DEVICE$ The device name opened, typically LPEX1 for the first printer opened by the application.
PTRID$ The printer ID as specified in Printer Control Maintenance.  Use this instead of FID() to base program logic on the particular printer opened.
PTRIDDESC$ Printer description associated with the Printer ID as specified in Printer Control Maintenance.
PTRTYPE$ Printer type as specified in Printer Control Maintenance.
PTRTYPEDESC$ Printer type description (from Printer Type file SM31)
PTRWIDTH$ Printer width (from SM31)
NNarrow carriage (8")
WWide carriage (13.2"+")
LINEDRAW$Indicates if the printer supports printing of box and line drawing graphics characters using high-order ASCII characters.  From Printer Type record (SM31).
PCLIndicates the printers support for PCL commands.  From Printer Type record (SM31).  Also used to indicate if the printer prints in color or just black ink.
0printer does not support PCL commands
1printer supports PCL, but non-scalable fonts.  Also indicates printing to a file and S084.PCL$ was passed as "Y" indicating that the application will send PCL commands to printer channel.
2printer supports PCL and scalable fonts
3color printer with PCL, scalable fonts, simple colors only (8 colors)
4color printer with PCL, scalable fonts, full color support including images
EPWIDTHIndicates the number of print positions used per character when using Y6.DWON$ to print double-width characters.

Print method selected 

1double wide characters not supported, print as single width characters
2double wide characters take 2 print positions
SIZEIndicates the paper depth or orientation selected.
111 inch paper depth - portrait orientation on a laser printer
28.5 inch paper depth - landscape orientation on a laser printer
DYNASTORE

Archive Option

NDocument not archived
SDynastore archive - Standard permissions
PDynastore archive - Personal access only
ADynastore archive - Unlimited access by All
UArchive in User's folder
OCustom Archive Option #1
ECustom Archive Option #2
JOBNOThe Dynamo Spooler job number which is the key to the Spooled Documents File CDSM35.
COMMENTComment text entered by user during printer selection or passed to CDS084 in S084.COMMENT$
SLAVEIndicates if the printer is accessed by printing to the workstation device using slave on/off characters.b
0printer selected is not a 'slave' printer
1printer selected has the same device name as the workstation or /dev/tty
PTDThe number of lines printed which can be set by the application to know at the end of the job if anything was printed. PTD is also incremented by CDS038.
ARCHIVEPROGSet by CDS084 and used by CDS094 when using a custom archive option. Note the global variable SMS_CDS084.CUSTOM is no longer used.
FILEOUTResolved file name containing output. Set when printing to a file, creating a pdf, or when S084.FILEOUT is specified when printing to a physical printer.
INITON$*Initialization string upon printer open
INITOFF$*Initialization string upon printer close
DWON$/DWOFF$*Double Wide on/off
DHON$/DHOFF$*Double High on/off
ULON$/ULOFF$*Underline on/off
BLDON$/BLDOFF$*Bold on/off
ITON$/ITOFF$*Italics on/off
RVON$/RVOFF$*Reverse printing (white letters on a black background) on/off
STLYENAME$[9]Names of different print styles from Printer Type Maintenance
STYLE$[9]*Codes to invoke each particular style
CPI10$*10 characters per inch
CPI12$*12 characters per inch
CPI15$*15 characters per inch
CPI17$*17 characters per inch
CPI20$*20 characters per inch
LPI6$*6 lines per inch
LPI8$*8 lines per inch
DEPTH11$*Page depth of 11 inches (portrait orientation for laser/ink-jet printers)
DEPTH85$*Page depth of 8.5 inches (landscape orientation for laser/ink-jet printers)
SOURCENAME$[6]Name of different paper sources
SOURCE$[6]*Codes to invoke each paper source
DESTNAME$[2]Name of different paper output destination
DEST$[2]*Codes to invoke destination
DUPLEX$[3]*Codes for each simplex/duplex printing mode (see above)
MODE$The MODE= string used on the OPEN of the printer
MSG$Display message such as Printing..., Spooling..., etc. including cursor positioning expression so that the application program need only PRINT Y6.MSG$,.

Note the old PRINT Y6$(90), is no longer supported.  Use the Program Utility Search and Replace option with standard Search & Replace arguments to replace this code.

* The fields in Y6$ marked with * can be used to change printing characteristics within the application.  For example, the PRINT statement to print double wide text, assuming the printer supports double wide printing, would be: PRINT (Y6.CH)'BO', Y6.DWON$, DATA$, Y6.DWOFF$,' EO'.  It is recommended that you only have one 'BO' and 'EO' per PRINT statement, and that you do not include any positioning expressions @() or other mnemonics between the 'BO' and 'EO'.

CDS084 also sets 'SP' and 'CP' which should be used within an program that needs to change from narrow to wide and/or wide to narrow characters per inch within the application.

Note that application programs should not print the 'FF' mnemonic, instead, use CDS094 for all new page and close printer logic.  By using CDS094, the application will best support printing to the display.

Applications that need to close the printer channel prior to returning to the menu, should CALL "CDS094",Y6$,"E" and not use CLOSE().

Config.bbx

CDS084 does not require an entry in the config.bbx file for each printer.  Printers are included on the printer selection list using Printer Control Maintenance (SMC).  The list of printers can be customized by workstation, user, or groups of users.  Refer to Printer Preference Maintenance (SMC) for additional details.  The only entries required in config.bbx are generic entries named LPEX1, LPEX2, LPEX3, LPEX4 and LPEX5.  You do not need to add entries as printers are added.  These entries will support up to 5 different printer channels open at one time per program.  Should an application require more than 5 simultaneous printer channels open at the same time, then additional config.bbx entries can be made.  Note that the FID(Y6.CH) will return LPEXn and not the printer ID.  The actual printer ID can be accessed from Y6.PTRID$.

If there is an entry for a printer in the config.bbx file, then CDS084 will use it instead of the generic LPEXn aliases.  This should only be done when applications open the printer directly without using CDS084.

When using CDS084 within a bbj stored procedure or trigger, be sure to specify a config file for the stored procedure or trigger in the Basis Enterprise Manager.  Dynamo Tools includes several configuration files that includes the required alias entries that can be used for this purpose.  See the files in the /u/CDI/CD/config folder with a file name in the format config.bbx.xxxx.

Cover Page Memo

A cover page memo may be entered by the operator when faxing.

Fax Cover Page Logo/Watermark

A logo or watermark can be printed on the fax coverpage by defining a file named XX/faxcover.prnXX represents the company code.  This document can be created using a word processor.  Email the document to support@excellware.com and we will convert it to the proper format.

Example

CALL "CDS084",ERR=EOJ,Y$,Y5$,0,"N",Y6,Y6$

This example will prompt the operator to select an output device to an available channel number.  The "N" indicates that the program will not require more that 80 columns, so both narrow and wide carriage printers will be permitted using operator specified characters per inch, lines per inch, etc.

Example

CALL "CDS041","CDS084",S084$,"YY"
S084.NAME="PFIL"
S084.FILEOUT="/u/reports/REPORT001"
CALL "CDS084",ERR=EOJ,Y$,Y5$,0,S084$,Y6,Y6$

Faxing

You fax using CDS084 much the same way you print.  You can populate fields in S084$ to enable faxing with or without operator intervention.  Refer to the fields in S084$ described above.

When using the VSIFAX option, you can use Fax Log & Options (PFM) to see if the fax was successfully sent.  By default, the fax software attempts to fax 5 times in 5 minute intervals.  If the line is busy or does not answer each time, or the phone number provided is not a fax#, then the fax will be unsuccessful.  You can schedule another 5 attempts, and change the fax# if desired, using the Fax Log & Options program.  When the fax is not successful, a Dynamo message is sent to the sender.

S084.NAME$ is "PFAX" for faxing using a fax modem and the third party VSIFAX software.  S084.NAME$="DFAX" for Dynafax which emails the fax as a PDF attachment then delivers to the fax machine.  Dynafax requires a third party software product to create the PDF file.  Faxing with dynafax is available at no extra charge with your Dynamo Tools Priority Support plan. Some exceptional apply. Contact Excellware for more information.

Faxing Example - no operator intervention
CALL "CDS041","CDS084",S084$,"YY"; REM "Obtain empty template
S084.MODE$="E"; REM "No operator entries other than error messages
S084.NAME$="DFAX"; REM "Fax using dynafax
S084.TONAME$="Jim Jones"
S084.TOCOMP$="Power Tool and Supply"
S084.TOFAXNO$="888-222-1234"
S084.SUBJECT$="Purchase Order# "+WM40.PONO$
S084.COVERPAGE$="N"
S084.PCL$="N"; REM "Application only sends text, not PCL commands
CALL "CDS084",ERR=EOJ,Y$,Y5$,0,S084$,0,Y6$; REM "Open printer channel
PRINT (Y6.CH)"Fax Example"
CALL "CDS094",Y6$,"E"; REM "Close printer channel
Internet Emailing

You can internet email using CDS084 much the same way you would print to a physical printer.  You can populate fields in S084$ to enable emailing with or without operator intervention.  You can email regular reports in the message body.  You can also attach one or more data files to an email using CDS184.

Internet Email Example with file attachment - no operator intervention
CALL "CDS041","CDS084",S084$,"YY"; REM "Obtain S084 template
S084.MODE$="E"; REM "No operator entries except for errors
S084.NAME$="MAIL"; REM "Internet Email
S084.TONAME$="Jim Jones"
S084.TOCOMP$="Power Tool and Supply"
S084.TOEMAIL$="jjones@powertool.com"
S084.EMAILCC$="support@excellware.com,manager@mycompany.com"; REM "Separate with comma
S084.SUBJECT$="Purchase Order# "+WM40.PONO$
S084.PCL$="N"; REM "Application program will send text, not PCL commands
CALL "CDS084",ERR=EOJ,Y$,Y5$,0,S084$,0,Y6$; REM "Open printer channel
PRINT (Y6.CH)"Email Test"; REM "This will appear in email body
CALL "CDS184",Y$,Y6$,"PRT/FILENAME.PDF","PONO12345"; REM "Attach file to email
CALL "CDS094",Y6$,"E"; REM "Close printer channel

When faxing and emailing, a record of the attempt is logged.  See the SMS menu for the fax and email logs.

You can disable the ability to fax and email by operator using Operator Information Maintenance (SMC).

CDX084A - Example of changing page orientation within document
0100 REM "CDX084A - 05/02/10 Example of portrait and landscape pages in same document
0110 SETESC 8000; SETERR 8000
0120 CALL "CDS084",ERR=EOJ,Y$,Y5$,U0,S084$,Y6,Y6$
0130 PRINT (Y6.CH)"This is plain text, on portrait page"
0140 CALL "CDS094",Y6$; REM "Finish page 1, start page 2
0150 PRINT (Y6.CH)'BO',Y6.DEPTH85$,'EO',; REM "Page 2 in landscape orientation
0160 PRINT (Y6.CH)"This is plain text, on landscape page"
0170 CALL "CDS094",Y6$; REM "Finish page 2, start page 3
0180 PRINT (Y6.CH)'BO',Y6.DEPTH11$,'EO',; REM "Page 3 in portrait orientation
0190 PRINT (Y6.CH)"This is plain text, on portrait page"
0200 CALL "CDS094",Y6$,"E"; REM "Complete document and close printer channel
0210 GOTO EOJ

8000 REM "Call Error/Escape Routine
8010 CALL "CDS063",STR(TCB(5)),Y$,PGM(-2)
8020 ON Y.ERRSTS GOTO 8030,8040,8050,8060
8030 SETERR 0
8040 RETRY
8050 RETURN
8060 RETRY

9000 EOJ:
9010 IF TCB(13) THEN EXIT
9020 RUN "CDS001"
Click to view example output