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

REXX Concatenate Datasets Dynamically


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

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Wed Sep 22, 2010 10:51 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Sep 22, 2010 11:11 pm
Reply with quote

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
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Wed Sep 22, 2010 11:23 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 22, 2010 11:25 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Sep 22, 2010 11:33 pm
Reply with quote

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
View user's profile Send private message
srikanth_cts

New User


Joined: 27 Feb 2008
Posts: 25
Location: Phoenix, AZ,USA

PostPosted: Thu Sep 23, 2010 11:00 am
Reply with quote

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
View user's profile Send private message
Kurt Deininger

New User


Joined: 13 Jul 2010
Posts: 19
Location: Frankfurt/Germany

PostPosted: Fri Sep 24, 2010 11:22 am
Reply with quote

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
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top