Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Rexx to pull a jobname and put it in an output with other lines of the same file

Status
Not open for further replies.

Saulfd1

Technical User
Dec 12, 2014
4
US
I have a file that has the following records (mainframe):
000001 RCVJXXXX 004 RCVJXXXX 000 ALL *NONE* *NONE* 005 015 1482 14345/1215
000002 DSN=REMOTE1.JOHN.AUT1
000003 DSN=REMOTE1.USER.CONT.DSN
000004 DSN=REMOTE1.JOHN2.TEMP
000005 DSN=REMOTE1.USER.CLIST
000006 DSN=REMOTE1.USER.PARMLIB
000007 RCVCXXX1 004 RCVCXXX1 000 ALL *NONE* *NONE* 005 015 0291 10029/1144
000008 DSN=REMOTE1.CENDA.AUTH1
000009 DSN=REMOTE1.USER.CONTEN.DSN
000010 DSN=REMOTE1.CEN3.TEMP
000011 DSN=REMOTE1.USER.CLIST
I need to code REXX to pull the jobname on line 1 and then create an output with that jobname plus the dataset in line2 then another line with the same jobname plus line 3 and so on. Then, when it encounters another jobname (line 7), repeat the process with the datasets below that jobname. I am not that familiar with REXX and am at a lost right now. Could someone help me? Thanks.
 
Some spaces were deleted. The files looks like this:
000001 RCVJXXXX 004 RCVJXXXX 000 ALL *NONE* *NONE* 005 015 1482 14345/1215
000002 DSN=REMOTE1.JOHN.AUT1
000003 DSN=REMOTE1.USER.CONT.DSN
000004 DSN=REMOTE1.JOHN2.TEMP
000005 DSN=REMOTE1.USER.CLIST
000006 DSN=REMOTE1.USER.PARMLIB
000007 RCVCXXX1 004 RCVCXXX1 000 ALL *NONE* *NONE* 005 015 0291 10029/1144
000008 DSN=REMOTE1.CENDA.AUTH1
000009 DSN=REMOTE1.USER.CONTEN.DSN
000010 DSN=REMOTE1.CEN3.TEMP
000011 DSN=REMOTE1.USER.CLIST

Thanks
 
It keeps removing the spaces before the datasets. I replaced the spaces with dots:
000001 RCVJXXXX 004 RCVJXXXX 000 ALL *NONE* *NONE* 005 015 1482 14345/1215
000002 .......DSN=REMOTE1.JOHN.AUT1
000003 .......DSN=REMOTE1.USER.CONT.DSN
000004 .......DSN=REMOTE1.JOHN2.TEMP
000005 .......DSN=REMOTE1.USER.CLIST
000006 .......DSN=REMOTE1.USER.PARMLIB
000007 RCVCXXX1 004 RCVCXXX1 000 ALL *NONE* *NONE* 005 015 0291 10029/1144
000008 .......DSN=REMOTE1.CENDA.AUTH1
000009 .......DSN=REMOTE1.USER.CONTEN.DSN
000010 .......DSN=REMOTE1.CEN3.TEMP
000011 .......DSN=REMOTE1.USER.CLIST
 
Well, without seeing your code I can only say it is line 47 of your rexx program.

How do you get the jobnames - user input or dataset? Either way it is, essentially, a 2-file match problem. How many records in the dataset you show and how many jobnames? If not too many of either then you could store the data for one dataset or the other or both in stems. You may be doing this already but we do not know.


Nic
 
Hello Nic,
Thank you for responding. I know that this is kind of weird to accomplish so I have not even started on any code. I am very new to REXXl. The jobnames and dataset names are in a dataset that is created by pulling the information from CA7 and was cleaned up to show only jobnames and datasets. The number of jobs and datasets below them can vary quite a bit. The output I am looking to attain is as follows:
RCVJXXXX DSN=REMOTE1.JOHN.AUT1
RCVJXXXX DSN=REMOTE1.USER.CONT.DSN
RCVJXXXX DSN=REMOTE1.JOHN2.TEMP
RCVJXXXX DSN=REMOTE1.USER.CLIST
RCVJXXXX DSN=REMOTE1.USER.PARMLIB
RCVCXXX1 DSN=REMOTE1.CENDA.AUTH1
RCVCXXX1 DSN=REMOTE1.USER.CONTEN.DSN
RCVCXXX1 DSN=REMOTE1.CEN3.TEMP
RCVCXXX1 DSN=REMOTE1.USER.CLIST
.
.
and so on. Any help will be greatly appreciated.
Thanks...Saul


 
Code:
read first record
do while more data
   extract jobname
   read next record
   do while more data and record contains string DSN=
      concatenate jobname in front of DSN
      write record
      read next record
   end
end
should just about do it from the top of my head.

You will need to read up on EXECIO, SUBSTR and Rexx concatenation.

To preserve spaces use the code tags (about the 18th formating tag) as in any forum.



Nic
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top