View previous topic :: View next topic
|
Author |
Message |
Lithikshaa
New User
Joined: 11 Dec 2020 Posts: 4 Location: India
|
|
|
|
Hello Team,
I have a requirement that I need to copy the content from filenames which is present in one PS input file to another PS output file having the same different file names and different LRECL.
e.g.,
Input PS file consider - ABC.DEF.INPUT.PS contains below list of files that contains the data,
ABC.INPUT.FILE1
ABC.INPUT.FILE2
ABC.INPUT.FILE3
All these files having the LRECL as 3000
here, I need to copy the content from these files to another PS file ABC.DEF.OUTPUT.PS which contains below output files in the same order.
ABC.OUTPUT.FILE1
ABC.OUTPUT.FILE2
ABC.OUTPUT.FILE3
But LRECL of above output files should be 3300. All Data from input file should be copied to output file (i.e., 3000) and remaining 300 should be spaces.
Will Sort steps work many files in PS to many files in another PS, for this condition ?
In REXX, we can copy only with the same LRECL, please let me know how to copy files from one LRECL to different LRECL.
Thank you in advance. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
In REXX, we can copy only with the same LRECL, please let me know how to copy files from one LRECL to different LRECL. |
horse manure |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Welcome!
I think you can write a Rexx and pass it to DFSORT/SORT PGM, which will blow the input data set and create SORTIN step expansion to those many concatenated data sets as in the original input and run DFSORT, the SORTOUT would have what you want. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Lithikshaa wrote: |
Hello Team,
I have a requirement that I need to copy the content from filenames which is present in one PS input file to another PS output file having the same different file names and different LRECL.
e.g.,
Input PS file consider - ABC.DEF.INPUT.PS contains below list of files that contains the data,
ABC.INPUT.FILE1
ABC.INPUT.FILE2
ABC.INPUT.FILE3
All these files having the LRECL as 3000
here, I need to copy the content from these files to another PS file ABC.DEF.OUTPUT.PS which contains below output files in the same order.
ABC.OUTPUT.FILE1
ABC.OUTPUT.FILE2
ABC.OUTPUT.FILE3
But LRECL of above output files should be 3300. All Data from input file should be copied to output file (i.e., 3000) and remaining 300 should be spaces.
Will Sort steps work many files in PS to many files in another PS, for this condition ?
In REXX, we can copy only with the same LRECL, please let me know how to copy files from one LRECL to different LRECL.
Thank you in advance. |
Your term “content of filenames” stands for “the names of datasets”, e.g. DSNAMES themselves, up to 44 characters each.
Please, first of all learn to distinguish apples from oranges. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2141 Location: USA
|
|
|
|
Lithikshaa wrote: |
In REXX, we can copy only with the same LRECL, please let me know how to copy files from one LRECL to different LRECL. |
Not sure about YOURSELF, but WE ALL can copy RECORDS with either same, or different LRECL, either in REXX or outside of REXX. This issue has nothing to do with REXX, or whatever else.
No one in this world can copy any LRECL to any other LRECL. LRECL is only an attribute of either a dataset, or a particular record in it. LRECL is just a number, like 1234. Nobody would be able to copy this 1234 neither to another 1234, nor to other 9876. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Reading a list of dataset names from a dataset and then doing something with those datasets has been asked before. The topics that refer to this process may not do exactly what you want to do but it should not be hard to adjust one of them to your requirement. You should search the forum - which you should have done before posting.
How many lines of data are to be copied? Large amounts, say over 50,000 lines, would make this an unsuitable use of Rexx althugh you could use your program to generate and submit copy jobs. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
I think most of the people that regularly respond to these queries will agree about this.- Your "requirement" is poorly worded, Something like this might be better. I would like to copy a data set containing fix length records with a record length of 3000 bytes to a new data set containing record length 3300 byte records. I would like the 300 extra bytes to contain blank characters.
- Rexx is a useful tool, but it is inappropriate for some tasks. Copying data sets containing a large number of records is not a good way to use Rexx.
Personally, I think your installation's sort/merge product, either DFSORT or Syncsort, can do this task with little, if any, trouble. Since we do not know what you have we cannot answer this query. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2594 Location: Silicon Valley
|
|
|
|
re: "I have a requirement that I need to copy the content from..."
It was not stated, but this seems like a one time task. I would just manually build and submit IEBGENER jobs. It will take 15 minutes, depending on how many data sets there are. |
|
Back to top |
|
|
Lithikshaa
New User
Joined: 11 Dec 2020 Posts: 4 Location: India
|
|
|
|
Thank you for your reply.
It would be good if you can give me the rexx code for this as am new to rexx. |
|
Back to top |
|
|
Lithikshaa
New User
Joined: 11 Dec 2020 Posts: 4 Location: India
|
|
|
|
Also the input file names will 300 - 500. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
Quote: |
It would be good if you can give me the rexx code for this as am new to rexx. |
and after you have been given the code what will you do if something does not go the way you want...
bother again asking to fix it ???
definitely You need to move to the beginners forum
will a good hearted moderator lock the topic, please |
|
Back to top |
|
|
|