IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Lets Brainstorm


IBM Mainframe Forums -> FAQ & Basics
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 02, 2009 4:27 am
Reply with quote

Hi ,

I would like to develop some kinda tool in REXX macro's or something more commonly used in sort or some sort of that ...but out of idea's ..

So have pulled in this brainstorming thread... with you all elite and lotssa experienced ppl ..

please jot down all the tools that have been impressed you or helped you to be more productive so far and a small description about its functionality ..

Let me begin.. first
The first thing i liked in REXX macro's A simple a very basic REXX macro which inserts entire job card when JC is typed in the command line .. comes handy ... saves at least a second in busy times icon_smile.gif

BTW .. am i comprehend able ??
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Sat May 02, 2009 11:51 am
Reply with quote

Hello,
karthik_sripal wrote:
So have pulled in this brainstorming thread...
What kind of brain stroming do you expect from the forum?

If this
Quote:
please jot down all the tools that have been impressed you or helped you to be more productive
is what you are looking for (By the way . . .productive . . . icon_confused.gif . . . icon_smile.gif . . . icon_wink.gif ) well, list might keep on growing and none of them might be useful for your shop because "my shop" is not tailored the way your is . . .

Quote:
The first thing i liked in REXX macro's A simple a very basic REXX macro which inserts entire job card when JC is typed in the command line .. comes handy
Ok, I've extension of this at my shop - which we call "JCLGEN". Which in combination with other "argument" produce different results; e.g.: JCLGEN JOBCARD - will generate Job card, JCLGEN SORT will Generate a general purpose SORT job . . . there are many other arguments which one can "pass" to JCLGEN.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 02, 2009 12:25 pm
Reply with quote

Do you mean that you wish to use ISPF macros, or do you really mean raw REXX macros.

The correct terminology is important to convey your request correctly.
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 02, 2009 2:15 pm
Reply with quote

Thanks for writing Anuj icon_smile.gif

Quote:
What kind of brain storming do you expect from the forum?


Jus collection of ideas of any kinda Productive tool developed by you and your colleagues or friends icon_smile.gif

Quote:
(By the way . . .productive . . . icon_confused.gif . . . icon_smile.gif . . . icon_wink.gif )

icon_smile.gif icon_lol.gif :wink
Quote:

well, list might keep on growing

Let them grow boss .. it is the ultimate goal here isnt it icon_smile.gif ??

Quote:

none of them might be useful for your shop because "my shop" is not tailored the way your is . . .


Quote:
Ok, I've extension of this at my shop - which we call "JCLGEN". Which in combination with other "argument" produce different results; e.g.: JCLGEN JOBCARD - will generate Job card, JCLGEN SORT will Generate a general purpose SORT job . . . there are many other arguments which one can "pass" to JCLGEN.

Cool Anuj.. we can have it implemented in our machine icon_smile.gif
This is the kind which am exactly looking for icon_smile.gif
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 02, 2009 2:18 pm
Reply with quote

expat wrote:
Do you mean that you wish to use ISPF macros, or do you really mean raw REXX macros.

The correct terminology is important to convey your request correctly.



Anything will do expat icon_smile.gif .. I jus need Ideas that is why i was careful not to use any restrictive keywords in my post icon_smile.gif

Thanks for writing expat icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 02, 2009 2:30 pm
Reply with quote

Well, if you don't know what you want - how can we know ???
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 02, 2009 2:43 pm
Reply with quote

expat wrote:
Well, if you don't know what you want - how can we know ???


Thanks for the reply expat ...

Am sorry that .... i think am misunderstood here...

lemme put it in a nutshell and try again ..

In Essence I would like to have ideas/Tools/ Process which is in place already or implemented in your work place that helped you and your colleague to do their job more faster .. and easier so that i can improve my work place

For Eg: JCLGEN Idea given by ANUJ D icon_smile.gif
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 02, 2009 4:16 pm
Reply with quote

Quote:
there are many other arguments which one can "pass" to JCLGEN.


And anuj .. can you please list down what other arguments are allowed ??
and also it would be great if you could share the source code of this JCLGEN
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon May 04, 2009 5:11 pm
Reply with quote

karthik_sripal wrote:
And anuj .. can you please list down what other arguments are allowed ??
Probably No, You asked for an idea only . . . please don't extend it.
Quote:
and also it would be great if you could share the source code of this JCLGEN
ah . . . you are asking for a copyright material - you tell us what you have done, where are you stuck up; some one will be around with a helping note.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 05, 2009 1:05 am
Reply with quote

Hello,

Quote:
it would be great if you could share the source code of this JCLGEN
Which was of course the goal from the beginning. . .

Less to do with ideas and more to do with code that can be adopted. . .
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue May 05, 2009 3:58 pm
Reply with quote

dick scherrer wrote:
Which was of course the goal from the beginning. . .
Really? It was not that evident . . . may be my small experience again at it's best . . . icon_neutral.gif. Should this be considered another "unclear post" . . . icon_wink.gif
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue May 05, 2009 10:24 pm
Reply with quote

Hi Anuj,

Quote:
Should this be considered another "unclear post" . . .
Probably not. . . It seemed pretty clear. . .
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sat May 09, 2009 3:53 pm
Reply with quote

So It Seems like asking for code looks like almost a crime here icon_redface.gif

I never know that jclgen is kinda copyrighted utility what i understood about that is that it is a kinda internally developed tool . and thought that the people will be glad to share the code and see it used and enhanced. totally my mistake i keep assuming things icon_sad.gif

Apologies !! Offense not indented.

And we can Restart the thread with only Ideas (no source)... if no issues.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Sat May 09, 2009 4:10 pm
Reply with quote

Quote:
So It Seems like asking for code looks like almost a crime here

Almost. It all depends on how you ask. A lot of times when the OP shows what they have achieved by themselves, the other forum members are (a) willing to help resolve problems, or (b) suggest / supply code to do something more efficiently.

I for one will post code that I have readily available from the past, or would contemplate writing the code if I find it challenging and if I also have sufficient time available to spec, code and test.

The most impertinent and unfortunately the most common way of asking for code is "please supply me the code to do this" or variations thereof. My usual response is that I will happily supply tested and documented code if the poster is willing to pay my day rate of 750 euros.

So, if you are willing to show us that you have made the effort yourself then the chances of getting either code or improvements to your own code are greatly improved.

I post this response in the vane hope that others will read it before begging for code without first lifting a finger to help themselves.
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Sun May 31, 2009 11:49 am
Reply with quote

Here we go.. code to bring the sort job template, as anuj's Jcl gen
Code:

/* REXX */                                                             
/*******************************************************************/   
/* TITLE      : JCLSORT                                            */   
/*-----------------------------------------------------------------*/   
/* FUNCTION   : TO BRING OUT A SORT JOB TEMPLATE IN ISPF EDIT/VIEW */   
/*            : SCREEN                                             */   
/*-----------------------------------------------------------------*/   
/* AUTHOR     : KARTHIK SRIPAL J 
/*                     e-addr removed          */   
/*AUTHOR NOTES: HAVE LET IT GO ON AIR ON 05/18/2009                */   
/*          : WOULD LIKE TO HEAR THAT IT HAS BEEN HELPFULL,SAVED TIME,*/
/*          : ENHANCEMENT POSSIBILITIES. IT WILL BRING A SMILE ON MY */
/*          : FACE                                                 */   
/*-----------------------------------------------------------------*/   
/* HOW TO RUN : ADD  THIS TO THE SYSPROC CONCATENATION OF THE NID  */   
/*            : PROF USE THE COMMAND JCLSORT TO INVOKE THE MACRO   */   
/*-----------------------------------------------------------------*/   
ADDRESS ISPEXEC                                                         
USER_ID = USERID()                                                     
"VGET ZACCTNUM"                                                         
"ISREDIT MACRO"                                                         
"ISREDIT (LINE) = LINENUM .FIRST"                                       
                                                                       
TEXT = "//"USER_ID"H JOB ("ZACCTNUM"),EBAXX.XX,"                       
"ISREDIT LINE_AFTER" LINE "= DATALINE '"TEXT"'"                         
                                                                       
"ISREDIT (LINE) = LINENUM .ZFIRST"                                     
                                                                       
TEXT = "//             MSGCLASS=H,CLASS=S,MSGLEVEL=1,"                 
"ISREDIT LINE_AFTER" LINE "= DATALINE '"TEXT"'"                         
                                                                       
TEXT = "//             NOTIFY=&&&&SYSUID,USER="USER_ID                 
"ISREDIT LINE_AFTER" LINE+1 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "//*"                                                           
"ISREDIT LINE_AFTER" LINE+2"= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "//STEP01   EXEC PGM=SYNCSORT"                                   
"ISREDIT LINE_AFTER" LINE+3 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "//SORTIN   DD DSN=XXXXXX.XXXXXX(XXXXXXX),DISP=SHR"       
"ISREDIT LINE_AFTER" LINE+4 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "//SORTOUT  DD SYSOUT=XXXXXX.XXXXX(XXXXXXXX),DISP=SHR "   
"ISREDIT LINE_AFTER" LINE+5 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "//SYSIN    DD * "                                               
"ISREDIT LINE_AFTER" LINE+6 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = "     SORT FIELDS=COPY "                                         
"ISREDIT LINE_AFTER" LINE+7 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = " --- SUM FIELDS=NONE "                                         
"ISREDIT LINE_AFTER" LINE+8 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = " --- SKIPREC=11222    "                                         
"ISREDIT LINE_AFTER" LINE+9 "= DATALINE '"TEXT"'"                       
                                                                       
TEXT = " --- STOPAFT=11222    "                                         
"ISREDIT LINE_AFTER" LINE+10 "= DATALINE '"TEXT"'"                     
                                                                       
TEXT = "--- OUTREC IFTHEN=(WHEN=(09,4,CH,EQ,C'D'),BUILD=(1,15,16:C'20))"
"ISREDIT LINE_AFTER" LINE+11 "= DATALINE '"TEXT"'"                     
                                                                       
TEXT = "/*"                                                             
"ISREDIT LINE_AFTER" LINE+12 "= DATALINE '"TEXT"'"                     
                                                                       
TEXT = "//SYSOUT   DD SYSOUT=*"                                         
"ISREDIT LINE_AFTER" LINE+13 "= DATALINE '"TEXT"'"                     
                                                                       
TEXT = "//SYSUDUMP DD SYSOUT=*"                                         
"ISREDIT LINE_AFTER" LINE+14 "= DATALINE '"TEXT"'"                     




would like to enhance this to perform better and with many possibilities and option ... i could see many possibilities, will keep adding this icon_smile.gif here


please write back if any one facing problem in executing.

advise and suggestion are most welcome icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Jun 02, 2009 6:52 pm
Reply with quote

Quite "static" in nature, try to make it "generic" -- Good Luck . . . icon_smile.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Tue Jun 02, 2009 11:43 pm
Reply with quote

... my coding preference would have ben more along the line
                                                                       
Code:
stmt.1  = "//"USER_ID"H JOB ("ZACCTNUM"),EBAXX.XX,"
stmt.2  = "//             MSGCLASS=H,CLASS=S,MSGLEVEL=1,"
stmt.3  = "//             NOTIFY=&&&&SYSUID,USER="USER_ID
stmt.4  = "//*"
stmt.5  = "//STEP01   EXEC PGM=SYNCSORT"     
stmt.6  = "//SORTIN   DD DSN=XXXXXX.XXXXXX(XXXXXXX),DISP=SHR" 
stmt.7  = "//SORTOUT  DD SYSOUT=XXXXXX.XXXXX(XXXXXXXX),DISP=SHR "
stmt.8  = "//SYSIN    DD * "
stmt.9  = "     SORT FIELDS=COPY "
stmt.10 = " --- SUM FIELDS=NONE  "                                                     
stmt.11 = " --- SKIPREC=11222    "                                                       
stmt.12 = " --- STOPAFT=11222    "                                                       
stmt.13 = "--- OUTREC IFTHEN=(WHEN=(09,4,CH,EQ,C'D'),BUILD=(1,15,16:C'20))"
stmt.14 = "/*"                                                             
stmt.15 = "//SYSOUT   DD SYSOUT=*"                                         
stmt.16 = "//SYSUDUMP DD SYSOUT=*"                                         
stmt.0  = 16

do  i = stmt.0 to 1 by -1
   text = stmt.i
    "ISREDIT LINE_BEFORE .ZFIRST = DATALINE '"TEXT"'"                       
end


or for an empty member

Code:
do  i = 1 to stmt.0
   text = stmt.i
    "ISREDIT LINE_AFTER .ZLAST = DATALINE '"TEXT"'"                         
end 
                                           
                         
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Wed Jun 03, 2009 1:13 am
Reply with quote

Thank you, now I have added sort to mine (and I like that style).
I have edit macros to generate JCL for job, exec, execims, dd, br14, gener, create gdg base, idcams repro, sort, ...
Mine will build these for dsns between the "cc" lines and places it after the "A" line or before the "B" line.
I also have edit macros to add a column of numbers, insert a constant in columns, copy columns, or increment numbers in columns, ... all between “CC” lines.
Back to top
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jun 03, 2009 1:23 am
Reply with quote

Thanks for that example, enrico. I have an edit macro that inserts a JOB statement at the beginning of whatever file I'm currently editing, but this looks much nicer. Mine is 30 years old and I never got around to converting it to REXX! Thanks again.
Back to top
View user's profile Send private message
genesis786

Active User


Joined: 28 Sep 2005
Posts: 210
Location: St Katherine's Dock London

PostPosted: Wed Jun 03, 2009 3:54 pm
Reply with quote

I have built something similar (i call that SORTY) using Skeletons. I use it to sort our shop's VSAM files and getting the output into a PS file.

Usage is:
Code:

TSO SORTY <dataset name (ksds)>


SKELETON:

Code:

//&JOBNAME JOB CLASS=H,MSGCLASS=X,                                   
//             NOTIFY=&SYSUID,MSGLEVEL=(1,1)                         
//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -       
//** EXECUTED BY: &USER                                             
//** ON: &DATE    AT  &TIME                                         
//* - - - - - - - - - - - - - - - - - - - - - - - - - - - - -       
//STEP10 EXEC PGM=IEFBR14                                           
//DD1 DD DSN=&OUTDSN,                                               
// DISP=(MOD,DELETE,DELETE)                                         
//**- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
//STEP20 EXEC PGM=SORT,COND=(4,LT)                                   
//SYSPRINT DD SYSOUT=*                                               
//SORTIN DD DSN=&INDSN,                                             
// DISP=SHR                                                         
//SORTOUT DD DSN=&OUTDSN,                                           
// DISP=(NEW,CATLG,DELETE),                                         
// SPACE=(CYL,(10,5),RLSE),                                         
 // DCB=(&LRECL,RECFM=FB,BLKSIZE=0)       
 //SYSIN DD *                             
   << ENTER SORT STATEMENTS HERE >>       
 /*                                       


REXX MACRO:

Code:

/* REXX */                                                         
/* ---------------------------------------------------------  */   
SAY 'ENTER DSN'                                                     
PULL INDSN                                                         
INDSN = STRIP(INDSN,,' ')                                           
IF SYSDSN("'"INDSN"'") ^= 'OK' THEN DO                             
  SAY 'ERROR: INPUT DSN NAME.. EXITING..'                           
  EXIT -1                                                           
END                                                                 
/* ---------------------------------------------------------  */   
DATE   = DATE()                                                     
TIME   = TIME()                                                     
USER   = USERID()                                                   
/* ---------------------------------------------------------  */   
JOBNAME = USERID() || "ST"                                         
SYSUID = "&SYSUID"                                                 
TMPDSN = "TGE.K2S.JCL"                                             
TMPJOB = USERID() || "KS"                                           
OUTDSN = SUBSTR(INDSN,1,LASTPOS('.KSDS',INDSN)-1)||'.SAMF'         
PFKEY   = ''                                                       
X = OUTTRAP('STEM.')                                               
ADDRESS TSO "LISTCAT ENTRY('"INDSN"') ALL"                         
X = OUTTRAP('OFF')                                                 
DO I = 1 TO STEM.0                                                 
 IF POS('AVGLRECL-------------',STEM.I) > 0 THEN DO                 
   STEM.I = WORD(STEM.I,2)                                         
   LEN = SUBSTR(STEM.I,LASTPOS('-',STEM.I)+1)                       
   LRECL = "LRECL="||LEN                                           
   LEAVE                                                           
 END                                                               
END                                                                 
/* ---------------------------------------------------------  */   
ADDRESS TSO "ALLOC FI(TMPJCL)   DA('"TMPDSN"("TMPJOB")')    SHR"   
ADDRESS ISPEXEC "FTOPEN TEMP"                                       
ADDRESS ISPEXEC "FTINCL REFSKEL2"                                   
ADDRESS ISPEXEC "FTCLOSE"                                       
ADDRESS ISPEXEC "VGET (ZTEMPN)"                                 
ADDRESS TSO"EXECIO * DISKR "ZTEMPN" (FINIS STEM SKEL."         
ADDRESS TSO"EXECIO * DISKW TMPJCL (FINIS STEM SKEL."           
ADDRESS ISPEXEC "EDIT DATASET ('"TMPDSN"("TMPJOB")'"           
ADDRESS TSO "FREE FI(TMPJCL)"                                   
BR "'"OUTDSN"'"                                                 
EXIT                                                           
/* ---------------------------------------------------------  */


Have something similar for copying a VSAM file into a PS file (for ftping sometimes) called that K2S (KSDS to Seq) and another S2K (Seq to KSDS). icon_smile.gif
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Tue Jun 09, 2009 7:38 pm
Reply with quote

Thanks to every one for pouring in their suggestions and code.. icon_smile.gif

Now i have another Idea, and am yet to make it breathe.

the idea is to insert the mod log i:e a predefined set of statements or test lines in a position denoted by a label, which a programmer can place at any line in the ISPF editor icon_smile.gif

this will help in having uniform mod logs across application and helps in maintainability icon_smile.gif

Guess it is possible in Rexx as well as Clist.

Any help/Input is more than welcome icon_smile.gif

and ideas to implement is most welcome icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Tue Jun 09, 2009 7:52 pm
Reply with quote

Code:

/* REXX *** EDIT MACRO TO INSERT GIVEN STANDARD CODE                 */
"ISPEXEC CONTROL ERRORS RETURN"                                       
"ISREDIT MACRO NOPROCESS"                                             
"ISREDIT PROCESS DEST RANGE A"                                         
"ISREDIT (FRL) = "LINENUM .ZFRANGE                                     
"ISREDIT COPY  'Source dataset(Member)' AFTER" FRL                           
Back to top
View user's profile Send private message
karthik_sripal

New User


Joined: 28 Mar 2008
Posts: 69
Location: 125.16.180.5

PostPosted: Tue Jun 09, 2009 9:13 pm
Reply with quote

Cool Expat icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> FAQ & Basics

 


Similar Topics
Topic Forum Replies
No new posts Executing ISPF application - Lets dive TSO/ISPF 17
No new posts Lets Lough General Talk & Fun Stuff 0
No new posts Live Healthy !!!Lets try to follow th... General Talk & Fun Stuff 0
Search our Forums:

Back to Top