View previous topic :: View next topic
|
Author |
Message |
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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
BTW .. am i comprehend able ?? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 . . . . . . . . . ) 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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thanks for writing Anuj
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
Quote: |
(By the way . . .productive . . . . . . . . . ) |
:wink
Quote: |
well, list might keep on growing |
Let them grow boss .. it is the ultimate goal here isnt it ??
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
This is the kind which am exactly looking for |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 .. I jus need Ideas that is why i was careful not to use any restrictive keywords in my post
Thanks for writing expat |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Well, if you don't know what you want - how can we know ??? |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 . . . . Should this be considered another "unclear post" . . . |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Anuj,
Quote: |
Should this be considered another "unclear post" . . .
|
Probably not. . . It seemed pretty clear. . . |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
So It Seems like asking for code looks like almost a crime here
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
Apologies !! Offense not indented.
And we can Restart the thread with only Ideas (no source)... if no issues. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
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 here
please write back if any one facing problem in executing.
advise and suggestion are most welcome |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quite "static" in nature, try to make it "generic" -- Good Luck . . . |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
... 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 |
|
|
Douglas Wilder
Active User
Joined: 28 Nov 2006 Posts: 305 Location: Deerfield IL
|
|
|
|
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 |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
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 |
|
|
genesis786
Active User
Joined: 28 Sep 2005 Posts: 210 Location: St Katherine's Dock London
|
|
|
|
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). |
|
Back to top |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Thanks to every one for pouring in their suggestions and code..
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
this will help in having uniform mod logs across application and helps in maintainability
Guess it is possible in Rexx as well as Clist.
Any help/Input is more than welcome
and ideas to implement is most welcome |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
karthik_sripal
New User
Joined: 28 Mar 2008 Posts: 69 Location: 125.16.180.5
|
|
|
|
Cool Expat |
|
Back to top |
|
|
|