Saturday, July 7, 2012

How To Create a Dataset In Rexx


Hi folks,

It becomes necessary for us to create dataset for many programming purpose.As creating a dataset using rexx is easy , I am just placing the code to create dataset in rexx.

Due to Security issues we are often allowed to create datasets only starting with the our TSO sign on ID. Thats's the reason why i have created the dataset with the TSO logon id and then i have later altered to the Dataset name which we actually wanted.

/*************** REXX at REXXPROGRAMMING.BLOGSPOT.COM***************/
USER_ID = USERID()
ACTUAL_PDS_NAME ='ACTUAL.PDS,NAME'
PDS_NAME_TO_ALTERED= USER_ID||".PDS.NAME "
   "ALLOCATE DATASET('"PDS_NAME_TO_ALTERED"') CATALOG LRECL (80),           BLKSIZE(27920) RECFM(F B) DSORG(PO) TRACKS SPACE(1 5) DIR(30)"

         "ALTER '"
PDS_NAME_TO_ALTERED "' NEWNAME('"ACTUAL_PDS_NAME"')"


EXIT.


This Should result in Creating a Dataset Named 'userid(tso id).pds.name' and altered to 'actual.pds.name'



<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33389906-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

How To Check If a Dataset Already Exist In REXX Programming


Folks,

       At times we are in need to know if few datasets already exist in HOST.It's a very easy piece of code that would help us to know if dataset exist or not.


/***************REXX AT REXXPROGRAMMING.BLOGSPOT.COM***************/

 IF SYSDSN("dataset.name") = "OK" THEN
    DO
            SAY "DATASET EXISTING"
    END
   ELSE
   DO

SAY "DATASET DOES NOT EXIST"

END
EXIT

where 'dataset,name' is the dataset to be checked for existence.



<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-33389906-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>