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

Dynamic file creation in Rexx


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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Sep 25, 2009 8:12 am
Reply with quote

Hi,

Please can someone help me in writing a REXX code for the below requirement -

(1) I have an input file with values of LRECL 6.
(2) I need to create a file(s) dynamically. Number of inputs may differ from run to run and the number of files to be created is equivalent to number of records from the i/p. Also the i/p value should be a part of filename (Second Level Qualifier).

Ex : If the input file has a value of test1, my file name looks like -
HLQ.test1.TLQ.FLQ
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Sep 25, 2009 9:25 am
Reply with quote

What have you tried?
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Fri Sep 25, 2009 7:21 pm
Reply with quote

Hello Murali,

I hope this might give you an idea.
Code:

//JOBCARD JOB ...
//STEP1   EXEC PGM=IEBGENER
//SYSUT1    DD DATA,DLM=@@
 /* REXX */
 TRACE O
 PARSE ARG XXDD
 OUTID = 1
 RDATA = 'DYNAMIC'
 OUT.OUTID = RDATA
 XXDSN = 'HLQ.'||XXDD||'.TLQ.FLQ'
 CALL BPXWDYN "ALLOC FI("XXDD") DA("XXDSN")",
              "NEW CATALOG CYL SPACE(1,1) UNIT(DISK)",
              "LRECL(80) RECFM(F,B) MSG(2)"
 "EXECIO "OUTID" DISKW "XXDD" (FINIS STEM OUT."
 "FREE F("XXDD")"
 SAY 'COMPLETED. CHECK YOUR DATASET' XXDSN
@@
//SYSUT2    DD DSN=&&PDS(DYNAMIC),DISP=(,PASS),
//             SPACE=(TRK,(1,1,1),RLSE),UNIT=VIO
//*
// SET XXDD=TEST1
//DYNAMIC  EXEC PGM=IRXJCL,REGION=0M,
//             PARM='DYNAMIC &XXDD.'
//SYSEXEC   DD DSN=&&PDS,DISP=(OLD,DELETE)
//SYSTSPRT  DD SYSOUT=*
//


Output:
Code:

 ISREDDE2   HLQ.TEST1.TLQ.FLQ                               Columns 00001 00072
 Command ===>                                                  Scroll ===> CSR
 ****** ***************************** Top of Data ******************************
 000001 DYNAMIC
 ****** **************************** Bottom of Data ****************************
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Sat Sep 26, 2009 8:43 am
Reply with quote

Hi Dominic,

Your script is working icon_smile.gif . Thanks for the help icon_biggrin.gif .
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 400
Location: Mumbai

PostPosted: Sat Sep 26, 2009 11:02 am
Reply with quote

The script also has an inconsequetial bug. The "FREE F("XXDD")" is a TSO command, that willnot run under IRXJCL. You can call BPXWDYN with a similar command using FI() instead of F() but in this example, step termination will free the data set anyway.
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Sun Sep 27, 2009 2:52 am
Reply with quote

Murali: You are welcome.

MBabu: Thanks for your comment.
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top