View previous topic :: View next topic
|
Author |
Message |
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
What have you tried? |
|
Back to top |
|
|
dominickim
New User
Joined: 28 Feb 2007 Posts: 65 Location: NS, CA
|
|
|
|
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 |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Hi Dominic,
Your script is working . Thanks for the help . |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
dominickim
New User
Joined: 28 Feb 2007 Posts: 65 Location: NS, CA
|
|
|
|
Murali: You are welcome.
MBabu: Thanks for your comment. |
|
Back to top |
|
|
|