Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Have you called SAS from a COBOL program?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics
View previous topic :: :: View next topic  
Author Message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 31, 2012 12:13 am    Post subject: Have you called SAS from a COBOL program?
Reply with quote

Has anyone (if it is even possible) called SAS from a COBOL program?

I've looked in the forums and on the web but have not found what i've been looking for.

Thanks,

d
Back to top
View user's profile Send private message

Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Wed Oct 31, 2012 12:30 am    Post subject:
Reply with quote

Since a SAS program is really the SYSIN to SAS, it would be SAS you'd calling.

A SAS program is interpreted, so I don't see how this would work.

Having said that, each SAS step is "compiled" in some sense, but not to object code, before being executed. I think one can pre-compile a SAS program, but would still need to execute SAS to run it. I have not done that.

What are you trying to do?
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1458
Location: Azeroth

PostPosted: Wed Oct 31, 2012 12:50 am    Post subject:
Reply with quote

Hi D,
I have once tried to call SAS from REXX just for knowing,
below is the code, Maybe this might give some idea of how to approach the problem with COBOL. One thing is, SAS requires SASLOG,SASUSER and SYSIN logical filenames to do its work.

Code:
/*REXX*/                                                                       
/*                                                                             
  "ALLOC F(SASLOG) DA('WELLS.SAS.LOG') NEW CATALOG DSORG(PS) RECFM(F B A),   
LRECL(133) BLKSIZE(0) CYL SPACE(1 1)"                                           
*/                                                                             
"FREE F(SASLOG SASUSER)"                                                       
"ALLOC F(SASLOG) DA('WELLS.SAS.LOG') SHR REUSE"                               
"ALLOC F(SASUSER)  DA('WELLS.SAS9.SASUSER') SHR"                             
"ALLOC F(SYSIN)  DA('WELLS.PROGRAM.PDS(SAS_PROGRAM_HERE)') SHR"                             
"CALL WELLS.SAS.V9R1M3.LIBRARY(SAS)"                                           
"FREE F(SASLOG SASUSER SYSIN)"                                                 
EXIT   


Hope it helps.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Oct 31, 2012 12:53 am    Post subject:
Reply with quote

Hi Phil,

One of my groups has a project where (a couple of weeks ago) they needed to generate a random number - using SAS. While SAS is on a system here, no one has experience/experise. As i'm one that inherits these "things". i asked here and got directon how to to this.

As ever, when something works, more must be better. Now they want to invoke this from some of their COBOL code and asked if i knew how as i'm the SAS guy . . . icon_confused.gif When they asked if i could look at this, gave my standard answer - "Sure i can look at it, might not be able to much about it - but i surely can look into it.".

Their client (Fedl Gov't) is high on SAS, so they are looking for "points" as well as the technical solution.

Guess i'd best download all of the SAS docs as i may need'em. . . icon_cool.gif

Thanks,

d
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Wed Oct 31, 2012 1:08 am    Post subject:
Reply with quote

Here's a possible dumb solution.

If they really need SAS random numbers, but can say the max they need (say, one billion), then just generate a file from SAS and read it into COBOL

A billion very small records is not too ridiculous.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> All Other Mainframe Topics All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us