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
 

 

Dynamic file creation in Rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
murmohk1

Senior Member


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

PostPosted: Fri Sep 25, 2009 8:12 am    Post subject: Dynamic file creation in Rexx
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

Senior Member


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

PostPosted: Fri Sep 25, 2009 9:25 am    Post subject: Reply to: Dynamic file creation in Rexx
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Sat Sep 26, 2009 8:43 am    Post subject:
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: 401
Location: Mumbai

PostPosted: Sat Sep 26, 2009 11:02 am    Post subject: Reply to: Dynamic file creation in Rexx
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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