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

Copy list of files from PS to another PS with different LREC


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Lithikshaa

New User


Joined: 11 Dec 2020
Posts: 4
Location: India

PostPosted: Fri Dec 11, 2020 11:07 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Fri Dec 11, 2020 11:50 pm
Reply with quote

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 icon_cool.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Sat Dec 12, 2020 12:13 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Sat Dec 12, 2020 1:07 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2140
Location: USA

PostPosted: Sat Dec 12, 2020 2:27 am
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2454
Location: Hampshire, UK

PostPosted: Sat Dec 12, 2020 3:24 am
Reply with quote

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
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Sat Dec 12, 2020 4:04 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2593
Location: Silicon Valley

PostPosted: Sat Dec 12, 2020 7:48 am
Reply with quote

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
View user's profile Send private message
Lithikshaa

New User


Joined: 11 Dec 2020
Posts: 4
Location: India

PostPosted: Sat Dec 12, 2020 12:30 pm
Reply with quote

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
View user's profile Send private message
Lithikshaa

New User


Joined: 11 Dec 2020
Posts: 4
Location: India

PostPosted: Sat Dec 12, 2020 12:36 pm
Reply with quote

Also the input file names will 300 - 500.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3076
Location: NYC,USA

PostPosted: Sat Dec 12, 2020 2:03 pm
Reply with quote

Try this way.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Sat Dec 12, 2020 3:04 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts Copy only TEXT or String from a record SYNCSORT 4
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Use Copy Utility DB2 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top