Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Converting SAS code to Cobol or Easytrieve

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

New User


Joined: 25 Dec 2012
Posts: 1
Location: India

PostPosted: Fri Jun 29, 2018 6:01 pm    Post subject: Converting SAS code to Cobol or Easytrieve
Reply with quote

My shop is planning to get rid of SAS from mainframes. Does anyone have experience in doing this using a third party product or an in house one? If possible, we would like to convert it to Cobol or Easytrieve. Please note that the SAS codes are running in batch through a JCL.
Back to top
View user's profile Send private message

steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 647
Location: The Universe

PostPosted: Fri Jun 29, 2018 6:50 pm    Post subject:
Reply with quote

My guess is that it is not possible, for practical purposes, for several reasons.
  • Much SAS processing is done by the statistics functions. Rewriting these functions in Cobol can be done, of course, but it would be a major effort by programmers that are very fluent in both statistics and Cobol. The real cost, I think, would be equivalent to several years of SAS license fees.
  • You did not mention the cost of transforming SAS data base data to "flat" data sets.

Did whoever proposed removing SAS think about these issues?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8363
Location: Dubuque, Iowa, USA

PostPosted: Fri Jun 29, 2018 9:13 pm    Post subject:
Reply with quote

If the SAS code is merely doing reporting using DATA steps, the conversion can be done. It will be costly, though -- at a previous employer I had a SAS program that was converted to COBOL. The COBOL version took a couple of months to develop (as opposed to a week or so of SAS coding) but did replicate the SAS report precisely.

If the SAS code has many PROC statements, conversion would be MUCH more expensive since the PROC functions would have to be duplicated and that could, potentially, require someone with a statistical background to provide assistance.

One option to consider would be World Programming System which sells a product that is supposed to duplicate SAS coding. Another option would be to install SAS on a PC or server and move the SAS processing from the mainframe to that machine. SAS licensing for a PC is much cheaper than mainframe pricing, if cost reduction is the impetus for the switch from SAS.
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1578
Location: Chennai

PostPosted: Fri Jun 29, 2018 11:38 pm    Post subject:
Reply with quote

Quote:
One option to consider would be World Programming System which sells a product that is supposed to duplicate SAS coding. Another option would be to install SAS on a PC or server and move the SAS processing from the mainframe to that machine. SAS licensing for a PC is much cheaper than mainframe pricing, if cost reduction is the impetus for the switch from SAS.

Adding to this it is possible to reduce the licensing cost with sub capacity licensing for SAS
http://support.sas.com/techsup/technote/ts773.pdf

Having worked only on SAS since I started, I think it will be very difficult to mimic what SAS does through COBOL.

For instance,
SAS can read records from a dataset or USS file and process and write records to a file/dataset all in 7 lines of code. And it provides great debugging options

Code:
data
infile
input
process
file
put
run
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


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

PostPosted: Sat Jun 30, 2018 3:00 am    Post subject:
Reply with quote

Totally non-trivial.

Example: variables in SAS are not typed. I can say
Code:
VAR = 123.5;
and later
Code:
VAR = 'ABC';
(Same variable)

Here's a good one:
Code:
A = B = C;
Evaluating from the right, if B=C, then A is set to 1, else A is set to 0.

There's plenty more. SAS is interpreted, not compiled.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8697
Location: Back in jolly old England

PostPosted: Mon Jul 02, 2018 11:56 am    Post subject:
Reply with quote

As Robert says - look at WPS. I have actually done a conversion from SAS to WPS for all of the SAS and SAS/AF applications

Otherwise it will be a long hard analysis and recode job
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


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

PostPosted: Tue Jul 03, 2018 9:35 am    Post subject:
Reply with quote

One very important issue with production SAS is the issuance of warnings and errors in the SASLog that are issued during the run as opposed to a COBOL compiler's messages.

To deal with this, I developed years ago a SASLog filter program with a list of all text to search the SASlog for. All SASLogs in the run were written to a dataset (or file (lol)) and then run thru the filter to produce a report of where such messages occurred with their context.

Filter program's table might be:
Code:
SEARCH_TOKENS = lowcase(
                         'invalid/'
                      || 'missing/'
                      || 'uninitialized/'
                      || 'was not found/'
                      || 'WARNING:/'
                      || 'ERROR/'
                      );



and the report:

Code:
08/04/2008         SASLog Filter
 9:56:16           C:\A - Test\SASLog - TEST - 2008-07-23 112233.log


Search Tokens
=============
error
invalid
missing
uninitialized
warning:
was not found


          Token           Line# Line -->
========================= ===== ========
missing                       2 1450  put 'TEST - MISSING uninitialized';
                                                  ~~~~~~~                                                                                                             

uninitialized                 2 1450  put 'TEST - MISSING uninitialized';
                                                          ~~~~~~~~~~~~~                                                                                               

missing                       6 TEST - MISSING uninitialized
                                       ~~~~~~~                                                                                                                       

uninitialized                 6 TEST - MISSING uninitialized
                                               ~~~~~~~~~~~~~                                                                                                         

error                         7 ERROR: Execution terminated by an ABORT statement at line 1451 column 1.
                                ~~~~~                                                                                                                               

error                         8 _ERROR_=1 _N_=1
                                 ~~~~~                                                                                                                               

warning:                     10 WARNING: The data set WORK.DATA35 may be incomplete.  When this step was stopped there were 0
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
No new posts SQL IN predicate using COBOL table jerryte DB2 16 Fri Jun 29, 2018 10:30 pm
No new posts Can we use a file both as input and o... Chiku kumar COBOL Programming 11 Thu Jun 28, 2018 3:30 pm
No new posts Varying List Select SQL Query In DB2 ... NikhilGuptaGaya DB2 5 Wed Jun 27, 2018 11:01 pm
No new posts converting '36000C'x Pedro PL/I & Assembler 4 Wed Jun 27, 2018 4:14 am
No new posts JCL COND CODE check juares castro JCL & VSAM 4 Tue Jun 26, 2018 7:43 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us