View previous topic :: View next topic
|
Author |
Message |
saithvis2
New User
Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi All,
I have a query regarding the rexx which i have created ,
Question:
i have a Parm card which has the name of the program and the compilation jcl for a particular rexx , (i scan through the pds which has set of compilation jcls' using the name of the program) and i create a flat file and re-write the jcl , substituting the program name , copylib and loadlib respectively. after creation of that flat file which is actuallly a jcl, the jcl gets submited .
Problem:
Now the flat file which i am creating is not accepting : RECFM(FB) . It says
invalid type for this particular option.
what modification shall i do in my rexx given below , that it accepts the same.
Thanks in advance !
rexx code:
Code: |
/* REXX */
CALL PARMREAD
I = 1
DO UNTIL I > TRAP.0
PARSE VAR TRAP.I PGMNAME JOBNAME RELEASE
IF I = 1 THEN DO
JOBNAMEPREV = JOBNAME
END
PDSNAMEPGM = "ABC.FEP."||STRIP(RELEASE)||".SOURCE"
PDSNAMECPY = "ABC.FEP."||STRIP(RELEASE)||".COPYLIB"
PDSNAMELNK = "ABC.FEP."||STRIP(RELEASE)||".LINKLIB"
PDSNAMESRC = "ABC.FEP.CNTL"
CALL ALLOCDS
IF I = 1 THEN DO
CALL GETJOB
END
ELSE DO
IF JOBNAMEPREV \= JOBNAME THEN DO
CALL GETJOB
JOBNAMEPREV = JOBNAME
END
END
J = 1
FNDFLG = 'N'
CPYFLG = 'N'
CALL BLDJCL
CALL WRITEOP
"SUB '"FILENAME"'"
I = I + 1
END
PARMREAD:
"EXECIO * DISKR INFILE(STEM TRAP."
RETURN
ALLOCDS:
FILENAME = "ABC.FEP."||PGMNAME||".SEQ"
/*"ALLOCATE DATASET('"FILENAME"') NEW SPACE(5,1) DSORG(PS) RECFM(F)",
"LRECL(80) BLKSIZE(800)"
IF RC > 0 THEN DO
SAY "ERROR " RC " FAILURE TO ALLOCATE DATASET " FILENAME
EXIT 8
END */
"ALLOC F(MYOUTDD) DS('"FILENAME"') SHR REUSE"
RETURN
GETJOB:
"ALLOC F(MYINDD) DS('"PDSNAMESRC"("JOBNAME")') SHR REU"
"EXECIO * DISKR MYINDD (STEM INPUT."
"FREE F(MYINDD)"
RETURN
BLDJCL:
DO UNTIL J > INPUT.0
IF POS(EXEC, TRANSLATE(INPUT.J)) > 0 THEN DO
IF POS(PROG, TRANSLATE(INPUT.J)) > 0 THEN DO
FNDFLG = 'Y'
PARSE VAR INPUT.J PART1 "PROG=" PART2
INPUT.J = PART1||"PROG="||PGMNAME||","
END
END
IF FNDFLG = 'Y' THEN DO
IF POS(COPYLIB, TRANSLATE(INPUT.J)) > 0 THEN DO
IF CPYFLG = 'N' THEN DO
INPUT.J = "// NULCPY1="||PDSNAMECPY||","
CPYFLG = 'Y'
END
END
END
IF FNDFLG = 'Y' THEN DO
IF POS(LINKLIB, TRANSLATE(INPUT.J)) > 0 THEN DO
INPUT.J = "// LINKLIB="||PDSNAMELNK
END
END
IF POS(SYSIN, TRANSLATE(INPUT.J)) > 0 THEN DO
JREF = J + 3
END
IF J = JREF THEN DO
INPUT.J = "// DD DSN="||PDSNAMEPGM||"("||PGMNAME||"),DISP=SHR"
END
OUTPUT.J = INPUT.J
J = J + 1
END
RETURN
WRITEOP:
OUTPUT.0 = INPUT.0
"EXECIO * DISKW MYOUTDD (STEM OUTPUT."
"FREE F(MYOUTDD)"
RETURN
|
Regards,
Vishal |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Looking at this part of your REXX:
Code: |
ALLOCDS:
FILENAME = "ABC.FEP."||PGMNAME||".SEQ"
/*"ALLOCATE DATASET('"FILENAME"') NEW SPACE(5,1) DSORG(PS) RECFM(F)",
"LRECL(80) BLKSIZE(800)"
IF RC > 0 THEN DO
SAY "ERROR " RC " FAILURE TO ALLOCATE DATASET " FILENAME
EXIT 8
END */
"ALLOC F(MYOUTDD) DS('"FILENAME"') SHR REUSE"
RETURN
|
The line that has ALLOCATE and including the next 5 lines are commented out, so the program would not be allocating any new dataset.
With those instructions commented out, the program is try to allocate an existing dataset, not creating a new one.
Also, you have a RECFM of F with a LRECL of 80 and a BLKSIZE of 800. If your LRECL does not equal your BLKSIZE (but is a multiple of), you may want to use RECFM of FB (fixed block) |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
saithvis2 wrote: |
Now the flat file which i am creating is not accepting : RECFM(FB) . It says
invalid type for this particular option. |
You need to check the TSO/E Commands Manual (or use TSO HELP ALLOCATE) to see how to code the RECFM parameter correctly. |
|
Back to top |
|
|
saithvis2
New User
Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Cpuhawg,
I had commented this out on purpose as it was not allwoing me too allocate a file with RECFM = FB , it was only allowing with the option B or F. (Sorry for the confusion, I had posted the rexx code , which i had modified as it was not working. )
But, the probem still remains.
Any advice will be of great help.
Regards
Vishal |
|
Back to top |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
Were you using the appropriate syntax?
|
|
Back to top |
|
|
saithvis2
New User
Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Cpuhawg,
Yes ! i have used the syntax:
Regards,
Vishal |
|
Back to top |
|
|
saithvis2
New User
Joined: 23 Dec 2005 Posts: 61 Location: Providence , US
|
|
|
|
Hi Cpuhawg,
I am having one of these days where nothing works , i guess .... yes it has started working . The problem was with space only in RECFM (F B), My appologies for last post, and thanx for rectifying the same .
Have a great weekend.
Regards,
Vishal |
|
Back to top |
|
|
|