Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem while creating the flat file for jcl using rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Problem while creating the flat file for jcl using rexx
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    Post subject: Re: Problem while creating the flat file for jcl using rexx
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

Moderator Team Head


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

PostPosted: Fri Aug 18, 2006 10:05 pm    Post subject: Re: Problem while creating the flat file for jcl using rexx
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    Post subject: Re: Problem while creating the flat file for jcl using rexx
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    Post subject: Re: Problem while creating the flat file for jcl using rexx
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    Post subject: Re: Problem while creating the flat file for jcl using rexx
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    Post subject: Re: Problem while creating the flat file for jcl using rexx
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts SYMNAMES problem jacobdng DFSORT/ICETOOL 7 Thu Dec 22, 2016 7:47 am
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us