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

Can we append the file using its physical name using REXX.


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Shashank Prasanna Modi
Currently Banned

New User


Joined: 28 Feb 2008
Posts: 7
Location: Mumbai

PostPosted: Mon Mar 03, 2008 4:50 pm
Reply with quote

I want to append file using its physical name say HQTSM.PROD.TS40015D.SORTED
to the file say HQTSM.PROD.TS40015D.SORTED.APPEND.
How can we achieve this through REXX?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 03, 2008 4:56 pm
Reply with quote

Your question is not clear icon_smile.gif

if it is a simple string manipulation...

Code:
suff = "some.suffix"
dsn1 = "some.dsname"
/* to be sure drop any dangling trailing dots */
dsn2 = strip(dsn1,"T",".") || "." || suff
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 03, 2008 4:56 pm
Reply with quote

Allocate the files and invoke a copy process such as IEBGENER
Back to top
View user's profile Send private message
Shashank Prasanna Modi
Currently Banned

New User


Joined: 28 Feb 2008
Posts: 7
Location: Mumbai

PostPosted: Mon Mar 03, 2008 5:13 pm
Reply with quote

My question is that I am having input file HQTSM.PROD.TS40015D.UNSORTED as it physical name and logical name as INPUT1. My requirement is that I want to append the file to another file using REXX but I want that REXX should refer HQTSM.PROD.TS40015D.UNSORTED using its logical name i.e. INPUT1.
Back to top
View user's profile Send private message
Shashank Prasanna Modi
Currently Banned

New User


Joined: 28 Feb 2008
Posts: 7
Location: Mumbai

PostPosted: Mon Mar 03, 2008 5:15 pm
Reply with quote

Shashank Prasanna Modi wrote:
My question is that I am having input file HQTSM.PROD.TS40015D.UNSORTED as it physical name and logical name as INPUT1. My requirement is that I want to append the file to another file using REXX but I want that REXX should refer HQTSM.PROD.TS40015D.UNSORTED using its logical name i.e. INPUT1.


Sorry the REXX should not refer HQTSM.PROD.TS40015D.UNSORTED using its logical name i.e. INPUT1.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 03, 2008 5:17 pm
Reply with quote

if You simply want to append a file to another file there is no need to use rexx...

Code:
//file1 dd ..... input file
//file2 dd disp=MOD,   output file


any program capable of reading/writing a sequential file will satisfy Your request
Back to top
View user's profile Send private message
Shashank Prasanna Modi
Currently Banned

New User


Joined: 28 Feb 2008
Posts: 7
Location: Mumbai

PostPosted: Mon Mar 03, 2008 5:24 pm
Reply with quote

enrico-sorichetti wrote:
if You simply want to append a file to another file there is no need to use rexx...

Code:
//file1 dd ..... input file
//file2 dd disp=MOD,   output file


any program capable of reading/writing a sequential file will satisfy Your request

I know it can done by other easy method also. But I require REXX so if in future more inout files which I need to append to the single output file then I won't be keep on changing the PROC to cater to those. Simply change in REXX should suffice. This is a main reason I want a REXX which can append the two or more files by referring their physical file names to a single output file.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon Mar 03, 2008 5:30 pm
Reply with quote

I do not know where You got those strange ideas, but
reading a dataset by ddname strongly implies that You will have to change
the invoking jcl as well

also in any case it would be simpler to change a jcl rather than a rex script or, best case,
You would want to make Your rexx dynamic making it to read a list of datasets to process and ...

and You will end up having to change the jcl to provide a new dataset' s list
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 03, 2008 5:43 pm
Reply with quote

Methinks this thread has a distinct correspondence to the one started by the OP in the JCL forum, regarding copying multiple datasets in one proc.

Anyway .....................

Read parm file record
Get GDG base name from parm file record
Issue LISTCAT and parse to resolve (0) gen
Alloc file by DSNAME to DDNAME required by xxxGENER
Alloc file for output to DDNAME required by xxxGENER - if not already alloc
Invoke xxxGENER
Free file(s) no longer reuired

Hopefully this will now resolve both threads
Back to top
View user's profile Send private message
kregen

New User


Joined: 16 Mar 2006
Posts: 21

PostPosted: Mon Mar 03, 2008 7:55 pm
Reply with quote

Hi,
i think you want to rename the File...

do this

Code:

   DSNOld    = "'HQTSM.PROD.TS40015D.SORTED'"
   DSNNew  = "'HQTSM.PROD.TS40015D.SORTED.APPEND'"
   ADDRESS 'TSO'
   'RENAME' DSNOld DSNNew


Thats all
Kregen[/code]
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 03, 2008 8:15 pm
Reply with quote

kregen wrote:
Hi,
i think you want to rename the File...

do this

Code:

   DSNOld    = "'HQTSM.PROD.TS40015D.SORTED'"
   DSNNew  = "'HQTSM.PROD.TS40015D.SORTED.APPEND'"
   ADDRESS 'TSO'
   'RENAME' DSNOld DSNNew


Thats all
Kregen[/code]

kregen
Have you actually read this thread or just decided to reply anyway ???
Back to top
View user's profile Send private message
kregen

New User


Joined: 16 Mar 2006
Posts: 21

PostPosted: Wed Mar 05, 2008 2:31 pm
Reply with quote

epat
excuse me.. was my mistake..
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 FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Running REXX through JOB CLIST & REXX 13
Search our Forums:

Back to Top