Tuesday, November 30, 2010

Why I like Mainframe SAS


I was horrified by Mainframe SAS first time when I saw it. I struggled many times to let SAS output ‘Hello World’ to the log and failed, and then I started to sweat. Finally my colleague came to rescue me by teaching me to how to insert JCL before the SAS codes. In a world where every programmer is spoiled by shinning GUI or IDE, I felt fairly uncomfortable to code flashing characters in a floating window by ISPF, a seemly unfriendly text editor. To make things even worse, SAS’s interactive mode was forbidden in my team. Then to test a program is like fumbling for the end in a dark tunnel: you don’t know what your result will be like until the system told you it is ready after minutes’ waiting. As the result, I just found myself totally lost. Eventually I survived in the mainframe kingdom and now I start to like MF SAS. Even though it is a relic from ancient ‘punch-card’ time, MF SAS still has some unique strength, comparing with its more popular peers, such as UNIX SAS and PC SAS.

The power of MF SAS comes from its combination with z/OS, ISPF and JCL as a whole. (1) Nature of sharing. Since we are dealing with a distant server through 3270 terminal, all datasets and program codes can be easily shared. Thus, it is not necessary to set up any FTP or file sharing server. Thousands of coworkers can seamlessly share their progress and keep synchronized. (2) Native sorting and concatenation. JCL can concatenate multiple files together simply by naming them in Data Definition step. System-wise Sort program is also very handy. (3) Quick setup of system options. JCL can help SAS specify some system options, which cannot be switched on/off within SAS itself. For example, the SASLIST and SASLOG files can be outputted to somewhere we want to check later. (4) Scheduling of a job. The code in JES, part of JCL, can order SAS to run at certain time without human’s intervention. That is a really cool feature: how about that SAS starts to run from 2am and I check the overnight result in the morning. (5) Pipeline statement in DD. From SAS 9.1, SAS supports pipeline, by which a library in MF can be translated into an equivalent library in SAS. It will save time to define datasets. (6) Subroutines in calling ISPF commands. SAS provides some subroutines, such as CALL ISPEXEC and CALL ISPLINK, to integrate ISPF. Besides those advantages above, another good thing is that in ISPF the datasets can be manually modified. That is a blessing for people tends to change small mistakes by themselves, instead of running program once again. In conclusion, SAS thrived from the mainframe period, and MF SAS is still visible and alive. Let us enjoy it and hope it to flourish again.

Reference:1. SAS®9.1.3 Companion for z/OS. SAS Publishing. 2004
2. Introduction to the New Mainframe: z/OS Basics. IBM Press. 2009

**********************AUTHOR(DAPANGMAO)----HCHAO8@GMAIL.COM***********************************;
//************MERGE THREE FILES AND SORT**************************
//MYSTEP01 JOB 1 'DAPANGMAO', CLASS=C, MSGCLASS=X, MSGLEVEL=(1,1),
// NOTIFY=*
// EXEC PGM=SORT
//SORTIN DD DSN=MYUNIT.MYLIB.MYDATA(CAT),DISP=SHR
// DD DSN=MYUNIT.MYLIB.MYDATA(DOG),DISP=SHR
// DD DSN=MYUNIT.MYLIB.MYDATA(PIG),DISP=SHR
//SORTOUT DD DSN=MYUNIT.MYLIB.MYDATA(MERGE),UNIT=STORAGE
// DISP=(NEW,CATLG),SPACE=(TRK,(25,5),RLSE),
// DCB=(RECFM=FB,LRECL=250, BLKSIZE=25000)
//SYSOUT DD SYSOUT=*
//SYSIN DD *
SORT FILEDS=(1,10,CH,A)
/*
//*******************SAS PROCEDURE TO CALCULATE MEANS*************
//MYSTEP02 JOB 1 'DAPANGMAO', CLASS=C, MSGCLASS=X,MSGCLEVEL=(1,1)
// NOTIFY=*
//*MAIN DEADLINE=(0400,A,12152010)
// EXEC SAS,
// OPTIONS='LOG=OUTLOG PRINT=OUTPRINT'
//*ALTERNAT EXEC SAS, CONFIG= MYUNIT.MYLIB.MYCONFIG
//MYINPUT DD DSN=&&MERGE,DISP=SHR
//OUTLOG DD DSN=MYUNIT.MYLIB.LOGDATA.OUTLOG,DISP=OLD
//OUTPRINT DD DSN=MYUNIT.MYLIB.LOGDATA.OUTPRINT,DISP=OLD

DATA MERGE1;
INFILE MYINPUT;
INPUT ANIMAL &9. TYPE &5. NUMBER 5.;
RUN;

PROC MEANS DATA=MERGE1;
CLASS TYPE;
VAR NUMBER;
RUN;
/*
//*******************BUILD A PIPE LIBRARY FOR SAS*************
//MYSTEP03 JOB 1 'DAPANGMAO', CLASS=C, MSGCLASS=X, MASGLEVEL=(1,1),
// NOTIFY=*
// EXEC SAS
//PIPELIB DD DSN=MYUNIT.MYLIB.MYDATA,LRECL=6144,RECFM=F,DSORG=PS,
// SUBSYS=(BP01,CLOSESYNC,ERC=DUMMY),LABEL=(,,,OUT)
//ADDON DD DSN=MYUNIT.MYLIB.MYDATA(FOX),DISP=SHR

DATA PIPELIB.CAT;
INFILE ADDON;
OUTPUT;
RUN;

DATA _NULL_;
CALL ISPEXEC(’SELECT PANEL(MAINDEV)’);
IF PLIRETV = 0 THEN PUT PLIRETV=;
RUN;
/*

34 comments:

  1. HI,

    I am working on mainframes, i would like to learn SAS with mainframe, could you please send any material to prabhakar.mfr@gmail.com

    Thanks in advance.........

    ReplyDelete
  2. Could you also please send the material to maheshbandla@rediffmail.com
    Thanks in advance..!!!

    ReplyDelete
  3. Hi, I am mainframe programmer and I want to learn SAS with mainframe, Please send some learning documents on prashantkher87@gmail.com

    ReplyDelete
    Replies
    1. http://mframes.blogspot.in/2014/03/sas-tutorials-with-examples-in.html

      Delete
  4. http://mframes.blogspot.in/2014/03/sas-tutorials-with-examples-in.html

    ReplyDelete
  5. pls check http://mframes.blogspot.in/2014/03/sas-tutorials-with-examples-in.html

    ReplyDelete
  6. Nice documentation..

    ReplyDelete
  7. http://mframes.blogspot.in/2014/03/sas-tutorials-with-examples-in.html

    ReplyDelete
  8. Hi - Good morning,

    I am working on mainframes, i would like to learn SAS with mainframe, Requested to please send basic OR any material to santhosh.nanjappa@tcs.com

    Thanks in advance !!

    ReplyDelete
  9. any one can provide me the link for downloading sas setup for mainframes

    Thanks,

    ReplyDelete
  10. I'm really glad that I found your wonderful post. I enjoy reading it and I learn a lot.

    ReplyDelete
  11. Get a wide range of packing and moving companies at helloenquiry.in. We endeavour to furnish the best packers and movers companies in Thane at ease of Internet. Packers and Movers Thane

    ReplyDelete
  12. Thanks for sharing such a great article and it’s helpful for everyone. Great Post
    please visit our wonderful website Packers And Movers Bangalore @ http://packersmoversbangalore.in/

    ReplyDelete
  13. This information you provided in the blog that was really unique I love it!!, Thanks for sharing such a great blog..Keep posting.
    Packers and Movers Delhi
    http://blog.packers-and-movers-delhi.in/
    http://packers-and-movers-delhi.in/packers-and-movers-guru-gobind-singh-marg-delhi

    ReplyDelete
  14. Christmas is an annual festival commemorating the birth of Jesus Christ, observed most commonly on December 25. merry christmas and happy new year coloring pages Many cultures celebrate the event in some manner

    ReplyDelete
  15. I came across and saw this post which seems to be a nice one.
    Life Experience Degrees

    ReplyDelete
  16. I came across and saw this post which seems to be a nice one.
    Life Experience Degrees

    ReplyDelete
  17. The most important and best tank cleaning companies Madinah
    http://www.atar-almadinah.com/khasil.html

    ReplyDelete
  18. No matter if some one searches for his required thing,
    therefore he/she desires to be available that in detail, so that thing is maintained over here.
    http://forsan-elnil.com/arabic/?id=1
    http://forsan-elnil.com/ م
    http://forsan-elnil.com/arabic/index.php?id=6
    http://forsan-elnil.com/arabic/index.php?id=2
    http://forsan-elnil.com/arabic/index.php?id=3
    http://forsan-elnil.com/arabic/index.php?id=5

    ReplyDelete
  19. It has the ability to work on all the various areas of cleaning Madinah so Neonol trust of our customers
    every high credibility even win the best cleaning company in Medina
    Cleaning apartments Medina cleaning Villas Madinah cleaning tanks Madinah

    http://tasaheelteeba.com/?p=68
    http://tasaheelteeba.com/?p=46
    http://tasaheelteeba.com/?p=41
    http://tasaheelteeba.com/?p=38
    http://tasaheelteeba.com/?p=21 ة
    http://tasaheelteeba.com/?p=8 ة
    http://tasaheelteeba.com/?p=215 ة
    http://tasaheelteeba.com/?p=225 ة
    http://tasaheelteeba.com/?p=192
    http://tasaheelteeba.com/?p=99 ة
    http://tasaheelteeba.com

    ReplyDelete
  20. Thanks for the best blog.it was very useful for me.keep sharing such ideas in the future as well. Thanks for giving me the useful information. I think I need it!
    Happy Wheels , FNAF World , Five Nights At Freddy's

    ReplyDelete
  21. The wise man will let his past to make him better not bitter
    Obat Herbal untuk BAB Berdarah Pada anak

    ReplyDelete
  22. once the website is really inspiring, I wish it good luck, the more cutting edge and always provide information that is useful, familiar greeting from our best link
    obat mata rabun

    ReplyDelete
  23. Menurunkan Berat Badan Setelah Melahirkan Dengan Cemilan For young mothers who are planning to have a baby, became obese after giving birth is a reasonable fear.

    ReplyDelete
  24. http://acemaxs31.com/obat-maag/
    http://acemaxs31.com/obat-herbal-infeksi-saluran-kemih/
    http://qr.net/bUbHk

    ReplyDelete
  25. http://acemaxs31.com/obat-osteoporosis-tradisional/
    http://acemaxs31.com/obat-mastitis-herbal/

    ReplyDelete
  26. Obat Bopeng Paling Ampuh

    » Bopeng bekas jerawat susah hilang?

    » Ingin wajah kembali bersih?

    » Ingin tampil cantik tanpa make up?

    » Mencari Obat Bopeng Paling Ampuh?

    Mari kita bahas tuntas masalahnya disini..!!

    Cara Pesan QnC Jelly Gamat

    Harga Masker Spirulina

    ReplyDelete
  27. Choose the best fitness trackers band under 5000 with a good fitness wearable you will get better results. best fitness bands under 5000

    ReplyDelete
  28. Looking for thoughtful gifts? Buy gift from one of the best gift store and make your parents happy. Give your parents beautiful gift this Christmas. unique gifts for dad

    ReplyDelete
  29. Best love, life, inspirational thought, motivational quotes, shayari, stories, facebook and whatsapp status. motivational quotes in hindi

    ReplyDelete