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
 
Can we append the file using its physical name using REXX.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: Can we append the file using its physical name using REXX.
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Mon Mar 03, 2008 4:56 pm    Post subject: Reply to: Can we append the file using its physical name usi
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: 8614
Location: Back in jolly old England

PostPosted: Mon Mar 03, 2008 4:56 pm    Post subject:
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    Post subject: Reply to: Can we append the file using its physical name usi
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    Post subject: Re: Reply to: Can we append the file using its physical name
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Mon Mar 03, 2008 5:17 pm    Post subject: Reply to: Can we append the file using its physical name usi
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    Post subject: Re: Reply to: Can we append the file using its physical name
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10373
Location: italy

PostPosted: Mon Mar 03, 2008 5:30 pm    Post subject: Reply to: Can we append the file using its physical name usi
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: 8614
Location: Back in jolly old England

PostPosted: Mon Mar 03, 2008 5:43 pm    Post subject:
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: 18

PostPosted: Mon Mar 03, 2008 7:55 pm    Post subject: Reply to: Can we append the file using its physical name usi
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: 8614
Location: Back in jolly old England

PostPosted: Mon Mar 03, 2008 8:15 pm    Post subject: Re: Reply to: Can we append the file using its physical name
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: 18

PostPosted: Wed Mar 05, 2008 2:31 pm    Post subject:
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    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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 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

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