Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
REXX Concatenate Datasets Dynamically

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: REXX Concatenate Datasets Dynamically
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: 6970
Location: porcelain throne

PostPosted: Wed Sep 22, 2010 11:11 pm    Post subject:
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: 1783
Location: Bloomington, IL

PostPosted: Wed Sep 22, 2010 11:23 pm    Post subject:
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

Site Director


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

PostPosted: Wed Sep 22, 2010 11:25 pm    Post subject:
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: 688
Location: Pennsylvania

PostPosted: Wed Sep 22, 2010 11:33 pm    Post subject:
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    Post subject: Reply to: REXX Concatenate Datasets Dynamically
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    Post subject:
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    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
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts The same REXX program doesnt work for... jackzhang75 CLIST & REXX 5 Wed Dec 06, 2017 2:51 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
This topic is locked: you cannot edit posts or make replies. Rexx to Grab ISMF Information. upendrasri All Other Mainframe Topics 16 Sun Nov 26, 2017 12:35 am
No new posts ICETOOL - RESIZE DYNAMICALLY kranthikumarb DFSORT/ICETOOL 0 Tue Nov 21, 2017 5:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us