View previous topic :: View next topic
|
Author |
Message |
srikanth_cts
New User
Joined: 27 Feb 2008 Posts: 25 Location: Phoenix, AZ,USA
|
|
|
|
Hi everyone,
I am in need of your help reg a requirement in REXX that I have got to concatenate the datasets having the same High Level Qualifier.
For ex:
HLQ1.test1.testr
HLQ1.test1.tests
HLQ1.test1.testt
I am not sure how many datasets will qualify the criteria of HLQ1.test1.*
but need to concatenate them and produce a single out put.
Note: All the datasets are having the same DCB.
On searching the forum and all posssible combinations, I found that ADDRSSU can be used to do it in JCL.
Is there a similar kind of function in REXX too.
Kindly direct me to any material that might be helpful
Srikanth |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
concatenating datasets is not the same as concatenating strings.
concatenating datasets is a term applied to JCL, whereby the one DD Reference has more than one DSN assigned.
concatenating strings means putting them together.
addrssu is a utility.
rexx is a 'programming language'.
and JCL is JOB CONTROL LANGUAGE.
things are not done in JCL, they are accomplished by JOBs,
that are described/defined by JCL.
now, what do you want to do? stop misusing terms and using chatroom-speak.
what does reg mean in:
Quote: |
your help reg a requirement |
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
I would use LISTCAT to create a list of data sets, OUTTRAPping the output and parsing it to winnow it down to just the DSNs.
If the total volume of data is small, you can EXECIO the input data sets to the output. If it is not, I would recommend executing IEBGENER one or several times, allocating some or all of the data sets (depending on their number) to SYSUT1 and the output to SYSUT2 with a DISP of MOD (in this case, I hope that, although you are looking for a Rexx solution, you will nonetheless execute it in the background, as it may otherwise tie up your terminal for some time). |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Dick,
reg - regarding?
If i understand the request, it is how to use a wildcard to read a series of datasets as though they are one file.
Unless these are very small files, i'd not recommend using rexx. . . |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
This requirement is not clear to me.
Do you want to simply concatenate the LIST of datasets and the output is the LIST of all the datasets.
OR
Do you want to concatenate all of the DATA contained within the list of datasets? |
|
Back to top |
|
|
srikanth_cts
New User
Joined: 27 Feb 2008 Posts: 25 Location: Phoenix, AZ,USA
|
|
|
|
Hi Akatsukami,
Thank you for replying. I think the solution you proposed might work for me. I will try it out and will post the outcome.
@Dick,
Sorry if my short message annoyed you. I was in hurry when I posted ,so forgot to do a spell check.
@dave,
I was looking for concatenating the data in multiple datasets into single dataset.
Regards,
Srikanth |
|
Back to top |
|
|
Kurt Deininger
New User
Joined: 13 Jul 2010 Posts: 19 Location: Frankfurt/Germany
|
|
|
|
Hi,
Try this:
Code: |
/* REXX */
CONCLIST=""
ADDRESS ISPEXEC
/* N.B: DATASET NAME TEMPLATE NOT BOUNDED BY SINGLE QUOTES */
"LMDINIT LISTID(LISTID) LEVEL(X1N1168.DATA*)"
DATASET=""
DO FOREVER
OK="4 8";"LMDLIST LISTID("LISTID") DATASET(DATASET)"
IF RC>0 THEN DO
LEAVE
END
CONCLIST=CONCLIST" '"STRIP(DATASET,"B")"'"
END
CONCLIST=SUBSTR(CONCLIST,2)
"LMDFREE LISTID("LISTID")"
ADDRESS TSO
/* N.B: DATASET NAMES NOW BOUNDED BY SINGLE QUOTES */
"ALLOC FI(TEMP) DA("CONCLIST") SHR REUSE"
"EXECIO * DISKR TEMP (OPEN STEM REC. FINIS)"
"FREE FI(TEMP)"
DO R=1 TO REC.0
SAY STRIP(REC.R,"T")
END
EXIT
USER X1N1168.DATA1 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 DATA1 LINE 1
000002 DATA1 LINE 2
000003 DATA1 LINE 3
****** **************************** Bottom of Data ****************************
USER X1N1168.DATA2 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 DATA2 LINE 1
000002 DATA2 LINE 2
000003 DATA2 LINE 3
****** **************************** Bottom of Data ****************************
USER X1N1168.DATA3 Columns 00001 00072
Command ===> Scroll ===> CSR
****** ***************************** Top of Data ******************************
000001 DATA3 LINE 1
000002 DATA3 LINE 2
000003 DATA3 LINE 3
****** **************************** Bottom of Data ****************************
When running:
DATA1 LINE 1
DATA1 LINE 2
DATA1 LINE 3
DATA2 LINE 1
DATA2 LINE 2
DATA2 LINE 3
DATA3 LINE 1
DATA3 LINE 2
DATA3 LINE 3
***
|
|
|
Back to top |
|
|
|