Hello Everyone!
There are some files in our environment that are created automatically each day by some REXX utility, these files are not GDG some of they are created by a variable (D&LYYMMDD) that puts the date at the end of the name of the file.
The files are created like this
SMF.LPAR.RACF.D200101
SMF.LPAR.RACF.D200102
SMF.LPAR.RACF.D200103
SMF.LPAR.RACF.D200104
SMF.LPAR.RACF.D200105
SMF.LPAR.RACF.D200106
This files always are created with the same 4 hlq (SMF.LPAR.RACF.DXXXXXX) the only thing that it chage are the numbers of the date
I'm creating a job that creates a report of RACF activity, but my inputs are those files. I want to schedule this job taking the last of those inputs.
Is there any way that I can do this? I'm guessing that I need to use some REXX program to do this.
Regards!!
How Can I take as an Input last file created by the Schedule
-
- Posts: 18
- Joined: Fri Feb 15, 2019 5:41 am
- Skillset: Data analytics with SMF records!
- Referer: Looking thru the internet
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How Can I take as an Input last file created by the Sche
Code: Select all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADDRESS TSO
x = OutTrap('Lines.')
"LISTC ENTRIES( 'SMF.LPAR.RACF.*' )"
x = OutTrap('OFF')
MaxName = ''
Do i = 1 To Lines.0
If 0 < Pos( ' ------- ', Lines.i ) Then Do
NewName = Word( Lines.i, 3 )
If MaxName < NewName Then
MaxName = NewName
End
End i
Say "MaxName="MaxName
/* Do whatever you want with this MaxName */
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: How Can I take as an Input last file created by the Sche
Another way may be using PARSE statement in REXX
Code: Select all
. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ADDRESS TSO
x = OutTrap('Lines.')
"LISTC ENTRIES( 'SMF.LPAR.RACF.*' )"
x = OutTrap('OFF')
MaxName = ''
Do i = 1 To Lines.0
Parse Var Lines.i . Separator NewName . /* extract words 2 and 3 from output line */
If 0 = Verify( Separator, '-' ) Then Do /* only when the second word includes nothing but '-' */
If MaxName < NewName Then
MaxName = NewName
End
End i
Say "MaxName="MaxName
/* Do whatever you want with this MaxName */
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Javas and Pythons come and go, but JCL and SORT stay forever.
-
- Posts: 130
- Joined: Tue Feb 01, 2011 7:12 pm
- Skillset: JCL, TWS, IBM Utilities
- Referer: Found on web
Re: How Can I take as an Input last file created by the Sche
What scheduler do you use? Date variables can certainly be substituted by TWS, and most likely all others as well.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 24
- 4466
-
by Pedro
View the latest post
Wed Jan 04, 2023 5:59 am
-
-
Can i read output file created after SORTing in the same pgm
by savitha_y » Sat Feb 06, 2021 1:17 am » in IBM Cobol - 4
- 1609
-
by savitha_y
View the latest post
Tue Feb 09, 2021 7:11 pm
-
-
-
File Handling 3 input files and 1 output file by using EZT
by pavan426 » Thu Sep 09, 2021 12:17 am » in CA-Easytrieve - 0
- 4413
-
by pavan426
View the latest post
Thu Sep 09, 2021 12:17 am
-
-
- 2
- 2723
-
by willy jensen
View the latest post
Sat Mar 04, 2023 12:41 pm
-
- 2
- 1339
-
by RazVorox
View the latest post
Tue Dec 05, 2023 11:06 am