The SAS Output Delivery System and reporting techniques

ODS a word doc in MVS?

Accepted Solution Solved
Reply
Contributor alr
Contributor
Posts: 39
Accepted Solution

ODS a word doc in MVS?

Hi,

I’m running SAS 9.1 on z/OS (MVS) and try to generate a report in MS Word The report have many elements both graphs and tables and will be sent to the users by email.


I can’t get graphs in the output document (instead of graphs I get just a line with some strange characters).

AsGraph.PNG

The table is fine but there are some strange characters on the top of the table as well.

topOfTable.PNG

I have no problem making PDF files (with graphs) but word documents seems not to be that easy?

Can anyone recommend a link to some useful papers about ODS and MS Word on mainframe (MVS)?

Here is my test code which I run in a JCL:
//......
//RTFFILE  DD DSN=XXXXXX,DISP=(NEW,CATLG,CATLG),
//            SPACE=(CYL,(1,3),RLSE),DATACLAS=DCMULTI,
//            DCB=(RECFM=VB,LRECL=8196,BLKSIZE=27998)
//G        DD DSN=XXXXX,DISP=(NEW,DELETE,DELETE),
//            SPACE=(CYL,(1,3),RLSE),DATACLAS=DCMULTI
//......


GOPTIONS RESET=ALL
         GSFMODE=REPLACE
         DEVICE=EMF
         GSFNAME=G
         ;

PROC GCHART DATA=SASHELP.CLASS;
VBAR SEX / NAME="TEST";
RUN;
QUIT:


OPTIONS ORIENTATION=LANDSCAPE;
ODS RTF FILE= RTFFILE STYLE=MINFONT RS=NONE TRANTAB=ASCII;

proc print data=sashelp.class noobs;
run;

proc greplay nofs
igout=Gseg;
replay test;
quit;


ODS RTF CLOSE;

and so:


FILENAME EMAIL EMAIL
TO=('.....


Accepted Solutions
Solution
‎09-29-2014 07:52 AM
Contributor alr
Contributor
Posts: 39

Re: ODS a word doc in MVS?

Here comes the solution, thanks to SAS support and these articles: http://support.sas.com/rnd/base/ods/templateFAQ/ODS91.pdf and http://support.sas.com/rnd/base/ods/odsrtf/rtf-tips.pdf

The strange signs are because I run an old version of SAS (9.1).

The solution is:
1- to use NOTOC_DATA option
2- remove the TRANTAB
3- use CT="TEXT/PLAIN" EXT="DOC" when I send the report by email


ODS RTF FILE= RTFFILE RS=NONE NOTOC_DATA;
ODS LISTING CLOSE;

proc print data=sashelp.class noobs;
run;

GOPTIONS RESET=ALL
GSFMODE=REPLACE
DEVICE=EMF
GSFNAME=G
;

PROC GCHART DATA=SASHELP.CLASS;
VBAR SEX / NAME="TEST";
RUN;
QUIT:

ODS RTF CLOSE;

FILENAME EMAIL EMAIL
TO=(xx@xx.com'<mailto:xx@xx.com'>
)
FROM=('xx@xx.com'<mailto:'xx@xx.com'>)
SUBJECT = "Test file "
ATTACH = ("xxxxx.xxxx"
NAME="filnavn"
CT="TEXT/PLAIN" EXT="DOC")
;
RUN;

DATA _NULL_;
FILE EMAIL;
PUT "Here is your file. ";
RUN;

View solution in original post


All Replies
Super User
Super User
Posts: 7,695

Re: ODS a word doc in MVS?

Hi,

Well, a few things there.  You are not creating a Word document to start with.  You are creating an RTF file, which is a text markup language, i.e. it is plain text with many keywords to help the reader interpret and display the data.  What you are seeing between those curly braces is RTF code.  However it also looks incorrect.  RTF code is {} indicates a group, the keyword tc should be prefixed by \ slash: {\tc ...}.  The TC is normally for table of contents - you could try options(contents=no) on the ods rtf line.  You may also want to take off the options: STYLE=MINFONT RS=NONE TRANTAB=ASCII;

Thirdly how are you viewing the file as interpreters vary.

Finally have you tried running your code on Windows, and opening the file still in Windows with Word?  Not sure if there are limitations of graph drawing on your OS, also with regards to the output of said graph being embedded into the RTF.

Contributor alr
Contributor
Posts: 39

Re: ODS a word doc in MVS?

Thank you.


contents=no made it even worst.

I’ve looked at this document http://support.sas.com/rnd/base/ods/templateFAQ/MVSODS3.pdf
But I guess our system is a bit different.

I’ll send the file to myself by email and open it in word.

FILENAME EMAIL EMAIL
TO=(xx@xx.com'
)
FROM=('xx@xx.com')
SUBJECT = "Test file "
ATTACH  = ("xxxxx.xxxx"
NAME="ZZZ"
CT="APPLICATION/MSWORD" EXT="DOC")
;
RUN;
DATA _NULL_;
FILE EMAIL;
PUT "Here is your file. ";
RUN;

The code works fine in PC SAS at windows. It works fine with ODS PDF on MVS as well.


Do you know any articles on how to create word documents with graphs on MVS?

Super User
Super User
Posts: 7,695

Re: ODS a word doc in MVS?

Sorry, I don't and nothing seems to come up on a Google.  Perhaps try an IT ticket on this one as it looks to me a bit like the tagset is outputting something incorrectly.

Solution
‎09-29-2014 07:52 AM
Contributor alr
Contributor
Posts: 39

Re: ODS a word doc in MVS?

Here comes the solution, thanks to SAS support and these articles: http://support.sas.com/rnd/base/ods/templateFAQ/ODS91.pdf and http://support.sas.com/rnd/base/ods/odsrtf/rtf-tips.pdf

The strange signs are because I run an old version of SAS (9.1).

The solution is:
1- to use NOTOC_DATA option
2- remove the TRANTAB
3- use CT="TEXT/PLAIN" EXT="DOC" when I send the report by email


ODS RTF FILE= RTFFILE RS=NONE NOTOC_DATA;
ODS LISTING CLOSE;

proc print data=sashelp.class noobs;
run;

GOPTIONS RESET=ALL
GSFMODE=REPLACE
DEVICE=EMF
GSFNAME=G
;

PROC GCHART DATA=SASHELP.CLASS;
VBAR SEX / NAME="TEST";
RUN;
QUIT:

ODS RTF CLOSE;

FILENAME EMAIL EMAIL
TO=(xx@xx.com'<mailto:xx@xx.com'>
)
FROM=('xx@xx.com'<mailto:'xx@xx.com'>)
SUBJECT = "Test file "
ATTACH = ("xxxxx.xxxx"
NAME="filnavn"
CT="TEXT/PLAIN" EXT="DOC")
;
RUN;

DATA _NULL_;
FILE EMAIL;
PUT "Here is your file. ";
RUN;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 593 views
  • 0 likes
  • 2 in conversation