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

Problem while creating the flat file for jcl using rexx


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Fri Aug 18, 2006 7:29 pm
Reply with quote

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
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Aug 18, 2006 9:34 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


Joined: 26 Apr 2004
Posts: 4652
Location: Raleigh, NC, USA

PostPosted: Fri Aug 18, 2006 10:05 pm
Reply with quote

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
View user's profile Send private message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Fri Aug 18, 2006 10:10 pm
Reply with quote

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
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Fri Aug 18, 2006 11:34 pm
Reply with quote

Were you using the appropriate syntax?

Code:

RECFM(F B)
Back to top
View user's profile Send private message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Sat Aug 19, 2006 12:24 am
Reply with quote

Hi Cpuhawg,


Yes ! i have used the syntax:
Code:

RECFM(F B)



Regards,
Vishal
Back to top
View user's profile Send private message
saithvis2

New User


Joined: 23 Dec 2005
Posts: 61
Location: Providence , US

PostPosted: Sat Aug 19, 2006 12:36 am
Reply with quote

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. icon_biggrin.gif


Regards,
Vishal
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top