View previous topic :: View next topic
|
Author |
Message |
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
As a result of this topic, I'm trying to make a temporary fix for backing up a few (VSAM) datasets, using a REXX script to generate and submit a JCL job.
The backed up dataset should contain a date as the lowest qualifier.
REXX code:
Code: |
date = DATE('S')
queue "//MYJOB JOB (...,...,...,...),...,CLASS=X"
queue "//STEP1 EXEC PGM=ADRDSSU,REGION=2048K"
queue "//SYSPRINT DD SYSOUT=*"
queue "//OUTVOL1 DD VOL=SER=VOL001,UNIT=SYSDA,DISP=SHR"
queue "//SYSIN DD *"
queue " COPY DATASET(INCLUDE(SOME.DATASET)) -"
queue " CANCELERROR -"
queue " OUTDDNAME(OUTVOL1) -"
queue " PERCENTUTILIZED(100) -"
queue " CATALOG -"
queue " RENAMEUNCONDITIONAL( -"
queue " (SOME.DATASET, -"
queue " SOME.DATASET." !! date !! ")) -"
queue " TGTALLOC(SOURCE) -"
queue " TOL(ENQF) -"
queue " FASTREP(PREF) -"
queue " WAIT(2,2)"
queue "/*"
ADDRESS TSO
"ALLOC F(JCL) SYSOUT WRITER(INTRDR)"
"EXECIO" QUEUED() "DISKW JCL (FINIS"
"FREE F(JCL)" |
When looking at the MYJOB output, it seems there's a synthax error. I guess the REXX script is using the date variable in wrong way.. Please advise.
Also, an idea for a better solution is welcome. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Ivan P wrote: |
When looking at the MYJOB output, it seems there's a synthax error. I guess the REXX script is using the date variable in wrong way.. Please advise. |
Please post you output with the syntax error..... |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
just from looking your concatenation looks incorrect
ie. HEX 4F4F
Gerry |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
also a qualifier in the dataset name containing all numerics will not work.
date variable contains all numerics
Gerry |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
The relevant part of the MYJOB output:
Code: |
IEC141I 013-20,IGG0199G,MYJOB,STEP1,SYSIN
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=013 REASON CODE=00000020
TIME=09.57.06 SEQ=12645 CPU=0000 ASID=003E
PSW AT TIME OF ERROR 075C1000 80E1005E ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN
DATA AT PSW 00E10058 - 41003B7A 0A0D41F0 38BE56F0
AR/GR 0: 9E1B3EDE/00000000_00E10324 1: 00000000/00000000_A4013000
2: 00000000/00000000_001F0C20 3: 00000000/00000000_00E0F7AA
4: 00000000/00000000_007C1410 5: 00000000/00000000_007C17A4
6: 00000000/00000000_007C174C 7: 00000000/00000000_007C17A4
8: 00000000/00000000_007C176C 9: 00000000/00000000_007C7028
A: 00000000/00000000_00000001 B: 00000000/00000000_00000001
C: 00000000/00000000_007C177C D: 00000000/00000000_00E08BEE
E: 00000000/00000000_80E0F8E2 F: 00000002/00000010_00000020
END OF SYMPTOM DUMP
IEF142I MYJOB STEP1 - STEP WAS EXECUTED - COND CODE 0012
....
PAGE 0001 5695-DF175 DFSMSDSS V1R09.0 DATA SET SERVICES 2010.050 09:57
ADR013I (SCH)-DSSU (01), 2010.050 09:57:06 TASK ABENDED WITH SYSTEM ABEND CODE 0013
ADR012I (SCH)-DSSU (01), 2010.050 09:57:06 DFSMSDSS PROCESSING COMPLETE. HIGHEST RETURN CODE IS 0012 FROM:
SYNTAX |
Gerry, after changing !! to ||, the output of the ISPSTART command (which I'm using to run REXX at the moment) was:
Code: |
READY
ISPSTART CMD(%MYREXX)
14 +++ queue " SOME.DATASET." |
1 +++ date = DATE('S')
IRX0013I Error running MYREXX, line 14: Invalid character in program
ISPD117
The initially invoked CLIST ended with a return code = 20013
MYUSER.SPFLOG1.LIST has been kept.
READY
END |
After adding a "D" before date variable concatenation, output remains the same..
Code: |
queue " SOME.DATASET.D" !! date !! ")) -" |
|
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Quote: |
After adding a "D" before date variable concatenation, output remains the same..
Code:
Code: |
queue " SOME.DATASET.D" !! date !! ")) -" |
|
Still I see ! not | |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Sambhaji, using | instead of !, gives the message described in my previous post, before the part about adding a non-numeric character. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Have you looked at the IEC141I message to tell you what the problem is.
Also, for the discussion of the concatenation character, depending on the language setup of the ISPF session, ! is sometimes used in place of |. Where I am now I use ! rather than | |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Yes.
Code: |
IEC141I 013-20,IGG0199G,MYJOB,STEP1,SYSIN |
Meaning there was an error in processing the module IGG0199G with RC 20, in job MYJOB, step STEP1, DD statement SYSIN.
Description of RC 20:
IBM wrote: |
An OPEN macro instruction was issued for a sequential data set using queued access. BLKSIZE is not a multiple of LRECL, or LRECL is 0 with RECFM=FB or RECFM=FBS, or BLKSIZE is not at least four bytes greater than LRECL with RECFM=V. |
Which doesn't make much sense to me, since running the job outside REXX (without using the date function) works.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Ivan P wrote: |
Which doesn't make much sense to me, since running the job outside REXX (without using the date function) works.. |
Yes, it would work outside of REXX when submitted from a JCL library.
A little food for thought. I have my suspiscions of what is causing the problem. Anyway, off for a meeting now, oh deep joy , and will share them after I get back. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
gcicchet wrote: |
Hi,
just from looking your concatenation looks incorrect
ie. HEX 4F4F |
The values are quite likely correct, but x'4F' does not display code-page invariant... |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
instead of writing to a the internal reader, try writing to a data set or the screen to verify that you are generating what you expect to generate |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
MBabu, a good idea.
But, could you please suggest how to modify this line to make REXX write to a dataset?
Code: |
"ALLOC F(JCL) SYSOUT WRITER(INTRDR)" |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Quote: |
could you please suggest how to modify this line to make REXX write to a dataset? |
Please see the help command for 'ALLOCATE' and see how to use the DATASET parameter. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
I was going to suggest
Code: |
"ALLOC F(JCL) SYSOUT WRITER(INTRDR) RECFM(F B) LRECL(80)" |
|
|
Back to top |
|
|
santosh.ambaprasad
New User
Joined: 08 Mar 2009 Posts: 16 Location: London
|
|
|
|
Hello there,
Referring to the message
Quote: |
IEA995I SYMPTOM DUMP OUTPUT
SYSTEM COMPLETION CODE=013 REASON CODE=00000020
TIME=09.57.06 SEQ=12645 CPU=0000 ASID=003E
PSW AT TIME OF ERROR 075C1000 80E1005E ILC 2 INTC 0D
NO ACTIVE MODULE FOUND
NAME=UNKNOWN |
I think, there is an issue allocating the DS in the JCL that is invoking this REXX.
Do you have SYSOUT allocated properly in your JCL?
Also, if you can write the output to a file and then copy it to INTRDR in next step, it provides better re-startability.
Am away from my VPN now.Once on it,I will try executing this program. |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Pedro wrote: |
Please see the help command for 'ALLOCATE' and see how to use the DATASET parameter. |
Done. For future reference to others - ALLOCATE synthax is in the TSO/E Command Reference book.
After writing the output to a dataset, it seems the job has no errors.
Except one.. I overlooked it seems.. (see bellow)
expat wrote: |
I was going to suggest
Code: |
"ALLOC F(JCL) SYSOUT WRITER(INTRDR) RECFM(F B) LRECL(80)" |
|
That helped. Thanks!!
Could You explain briefly why it doesn't work without RECFM and LRECL parameters?
@santosh.ambaprasad
Thanks for Your suggestion. It seems You were on the right track. Modification suggested by expat solved the problem.
Now... the thing I overlooked is that, I'm using DATE('S') function, which returns the date, in a 8 character format + an additional "D" (because dataset qualifier can't have all numerics) is 9 characters, which is invalid..
So I played with the date string a bit...
Here's my final working REXX.. Hope someone finds it useful in the future
Suggestions/improvements welcome, as always.
Code: |
date = DELSTR(DATE('S'),1,2)
year = DELSTR(date,3)
mnth = DELSTR(date,1,2)
mnth = DELSTR(mnth,3)
day = DELSTR(date,1,4)
date = day !! mnth !! year
queue "//MYJOB JOB (...,...,...,...),...,CLASS=X"
queue "//STEP1 EXEC PGM=ADRDSSU,REGION=2048K"
queue "//SYSPRINT DD SYSOUT=*"
queue "//OUTVOL1 DD VOL=SER=VOL001,UNIT=SYSDA,DISP=SHR"
queue "//SYSIN DD *"
queue " COPY DATASET(INCLUDE(SOME.DATASET)) -"
queue " CANCELERROR -"
queue " OUTDDNAME(OUTVOL1) -"
queue " PERCENTUTILIZED(100) -"
queue " CATALOG -"
queue " RENAMEUNCONDITIONAL( -"
queue " (SOME.DATASET, -"
queue " SOME.DATSET.D" !! date !! ")) -"
queue " TGTALLOC(SOURCE) -"
queue " TOL(ENQF) -"
queue " FASTREP(PREF) -"
queue " WAIT(2,2)"
queue "/*"
ADDRESS TSO
"ALLOC F(JCL) SYSOUT WRITER(INTRDR) RECFM(F B) LRECL(80)"
"EXECIO" QUEUED() "DISKW JCL (FINIS"
"FREE F(JCL)" |
|
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Rather than faff about taking different bits from the current date why not use the code below.
This gives the date in YYMMDD format which keeps the datasets in chronological order when displayed via 3.4
Code: |
DATEOUT = "D"||RIGHT(DATE('S'),6) |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
a more elegant way of parsing the date would be ... to use the PARSE function
Code: |
parse value(date("S")) with 3 yy 5 mm 7 dd
fdate = dd || mm || yy |
another concern,
usually the file <timestamps> are <ordered> YYMMDD so that a 3.4 display
would more clear/useful
in that case a simple
Code: |
fdate = substr(date("S"),3) |
would give the desired token |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Thanks for the suggestions guys, noted!
One other thing.. Does anyone know how could this be ran under System Automation?
When put in it's scheduler, the REXX doesn't function properly, and the NetView log outputs...
Code: |
75 *-* "ALLOC F(JCL) SYSOUT WRITER(INTRDR) RECFM(F B)
+++ RC(-3) +++
76 *-* "EXECIO" QUEUED() "DISKW JCL (FINIS"
+++ RC(-3) +++
77 *-* "FREE F(JCL)"
+++ RC(-3) +++ |
I guess running the REXX as a SysREXX is one solution, but is it a proper one in this case? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
Those are TSO commands and they require a TSO environment. I doubt they will work from a system rexx environment either.
For ALLOCATE and FREE, try to use BPXWDYN to do similar functions. You might want to see the Netview manuals about how you can write to a file from Netview. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
You probably figured this out already, but its counter-productive to test in one environment and then try to execute in a different environment. |
|
Back to top |
|
|
Ivan P
New User
Joined: 08 Jun 2009 Posts: 63 Location: Europe
|
|
|
|
Pedro wrote: |
Those are TSO commands and they require a TSO environment. I doubt they will work from a system rexx environment either. |
You're right, they don't work.
Pedro wrote: |
You probably figured this out already, but its counter-productive to test in one environment and then try to execute in a different environment. |
Indeed. I thought the transition would be easier or that Netview can use TSO environment somehow. Learning on my own mistakes.. |
|
Back to top |
|
|
|