[Tutor] Script to generate statements
Charles Leviton
charles.leviton at gmail.com
Sun Mar 17 19:24:29 CET 2013
Hi thanks for the response
On Fri, Mar 15, 2013 at 5:43 PM, Hugo Arts <hugo.yoshi at gmail.com> wrote:
> On Fri, Mar 15, 2013 at 9:03 PM, Hugo Arts <hugo.yoshi at gmail.com> wrote:
>
>>
>> I have a few comments
>>
>> * Does the script work? If yes, I'd say it's probably fine. Pretty short
>> so easy to understand whatever you do, and I see no obviously crazy broken
>> s**t in there. I don't much like 'fi' and 'fo' for variable names because I
>> have no idea what it means, but it's not a huge issue in a script this
>> small. If anything, I'd suggest more descriptive variable names and just a
>> tad mor
>>
> e use of underscores in them to make it easier on the eyes. Google PEP 8
>> and check it out, it's the python style guide.
>>
>>
> Sure- will do that going forward. as you can see for two of the files I
have gone with descriptive names.
>
>>
>> * I have no clue what DBRM or JCL are, and what a bind statement is.
>> Ideally, if you could give us some examples of what your input and output
>> looks like, I have a much better idea of what the script is trying to do.
>>
>>
> I already provided the example of the "template". The other file has a
list of the DBRMs like so
bindjcldbrmlist.txt
BBDTMC10
BBLAMC06
BBLAMC07
BBLAMC16
BBLAMC24
BBLAMC25
BBLBMC02
BBMTLC01
E5623941
F0829057
F0829073
Output would look like this (first 11 lines are the "fixed" part of the
output)
//SC10D01B JOB (SCM,RBSTC),'COOLGEN',MSGCLASS=A,CLASS=P,
// COND=(4,LT)
//*
//BIND EXEC PGM=IKJEFT01,DYNAMNBR=50
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//DBRMLIB DD DSN=SCLM.PROD.DBRMLIB,DISP=SHR
// DD DSN=SCLM.EMER.DBRMLIB,DISP=SHR
// DD DSN=JOYCE,DISP=SHR
//SYSTSIN DD *
DSN SYSTEM(DSN)
BIND PACKAGE(PROD) -
MEMBER(BBDTMC10) -
OWNER(SYSDB2) -
QUALIFIER(PRODDB2) -
ISOLATION(CS) -
EXPLAIN(YES) -
ACTION(REPLACE) -
CURRENTDATA(YES) -
VALIDATE(BIND)
BIND PACKAGE(PROD) -
MEMBER(BBLAMC06) -
OWNER(SYSDB2) -
QUALIFIER(PRODDB2) -
ISOLATION(CS) -
EXPLAIN(YES) -
ACTION(REPLACE) -
CURRENTDATA(YES) -
VALIDATE(BIND)
etc..etc
>
>>
>>
>> * Not knowing what version of python you have greatly limits the amount
>> of useful advice I can give you. More modern versions support stuff like
>> with statements to simplify file handling and the str.format function which
>> may be very useful in your template (you could also use % style formatting,
>> perhaps?). But if you're still on 2.5, which wouldn't surprise me on a big
>> mainframe, you don't have the cool stuff yet.
>>
>>
> I am not doing this on the mainframe. IBM mainframe doesn't have Python
(at least not on z/OS), it has its own scripting language called REXX which
is what I'd normally have written this in. I am doing this with Python 2.7
on windows after downloading the necessary input files from the mainframe
and I'll upload the output back to the mainframe to run the job that was
created
> Like I said in the first point though, the script is very small and
>> everything looks quite reasonable. It seems readable enough *if* you know
>> what kind of input and output date it's dealing with.
>>
>> HTH,
>> Hugo
>>
>
> just fyi, my previous mail to you (quoted above) was blocked by leeds
> learning for "unacceptable language." The only thing I could think of in it
> that triggered the filter is s**t (I've also censored it out above). But
> you might want to consider using a different address for communications
> with public mailing lists. We're all here on our free time volunteering to
> help out, and I'm not keen on going through the trouble of re-sending
> e-mails and censoring myself just so I can help a stranger. No bad feelings
> or anything, just pointing this out :)
>
> Happy to oblige, but not sure I fully understand. I'm using a gmail
account and sending a mail to tutor at python.org What should I be doing
differently?
> Hugo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20130317/944af6f2/attachment.html>
More information about the Tutor
mailing list