View previous topic :: View next topic
|
Author |
Message |
Shashank Prasanna Modi Currently Banned New User
Joined: 28 Feb 2008 Posts: 7 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Your question is not clear
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Allocate the files and invoke a copy process such as IEBGENER |
|
Back to top |
|
|
Shashank Prasanna Modi Currently Banned New User
Joined: 28 Feb 2008 Posts: 7 Location: Mumbai
|
|
|
|
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 |
|
|
Shashank Prasanna Modi Currently Banned New User
Joined: 28 Feb 2008 Posts: 7 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
Shashank Prasanna Modi Currently Banned New User
Joined: 28 Feb 2008 Posts: 7 Location: Mumbai
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
kregen
New User
Joined: 16 Mar 2006 Posts: 21
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
kregen
New User
Joined: 16 Mar 2006 Posts: 21
|
|
|
|
epat
excuse me.. was my mistake.. |
|
Back to top |
|
|
|