|
View previous topic :: View next topic
|
| Author |
Message |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Hi,
I have input file as
| Code: |
23.33.02 J0044018 $HASP373 A123456D STARTED - WLM INIT -
23.33.02 J0044018 IEF403I A123456D - STARTED - TIME=23.33.02
23.33.10 J0044018 IEF404I A123456D - ENDED - TIME=23.33.10
23.33.10 J0044018 -A123456D ENDED. NAME-OPCVARS TOTAL CPU TIME= .00 TOTAL ELAPSED TIME= .13
|
I have coded like
| Code: |
INCLUDE COND=(40,12,CH,EQ,C'STARTED - TIME',OR,
40,12,CH,EQ,C'ENDED - TIME',OR,
65,15,CH,EQ,C'TOTAL CPU TIME=',OR,
88,19,CH,EQ,C'TOTAL ELAPSED TIME=')
|
I am getting output like
| Code: |
23.33.02 J0044018 IEF403I A123456D - STARTED - TIME=23.33.02
23.33.10 J0044018 IEF404I A123456D - ENDED - TIME=23.33.10
23.33.10 J0044018 -A123456D ENDED. NAME-OPCVARS TOTAL CPU TIME= .00 TOTAL ELAPSED TIME= .13
|
I want to build output in format like
| Code: |
JOBNAME,CPUTIME,START TIME,END TIME
A123456D,0.00,23.33.02,23.33.10
|
|
|
| Back to top |
|
 |
anshul_gugnani
New User

Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hi,
Do you have just one set or record in input file or there can be multiple such sets. Please also mention the record length and type of input file.
Thanks,
Anshul. |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
There will set of such records.
RECLEN of INPUT file is 134. I just need logic so you can take arbitrary position of words in a line.
Thanks |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| There will set of such records |
Does this mean "there will be only one set of such records" or does it mean "there will be more than one set of such records"?
| Quote: |
| I just need logic so you can take arbitrary position of words in a line. |
Will 'STARTED - TIME' always start in position 40?
Will 'ENDED - TIME' always start in position 40?
Will 'TOTAL CPU TIME=' always start in position 65?
Why do you need 'TOTAL ELAPSED TIME=' in the INCLUDE statement since it will keep the same record as 'TOTAL CPU TIME='?
Is the .13 really on a separate line or is it at the end of the TOTAL CPU TIME line? |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
There will be more than one such set of records.
And All below statemnets are true
'STARTED - TIME' always start in position 40
'ENDED - TIME' always start in position 40
'TOTAL CPU TIME=' always start in position 65
And thanks Frank for informing that CPU TIME and ELAPSED TIME will be same. So I will be needing only one of that CPU TIME. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| There will be more than one such set of records. |
Do you want one output record for each set?
Does a set always consist of 'STARTED - TIME', 'ENDED - TIME' and 'TOTAL CPU TIME=" records in that order?
Can we identify the start of a "set" by 'STARTED - TIME' and the end of a "set" by 'TOTAL CPU TIME='? Will that always get us the three records we need? |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
Yes Frank, I am looking for one row for easch set
Yes we will be having same scenario.
| Quote: |
Can we identify the start of a "set" by 'STARTED - TIME' and the end of a "set" by 'TOTAL CPU TIME='? Will that always get us the three records we need?
|
Yes set will also be like this
| Quote: |
Does a set always consist of 'STARTED - TIME', 'ENDED - TIME' and 'TOTAL CPU TIME=" records in that order?
|
|
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
| Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(40,14,CH,EQ,C'STARTED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(135:SEQ=1,136:28,8,144:55,8)),
IFTHEN=(WHEN=GROUP,BEGIN=(40,12,CH,EQ,C'ENDED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(152:53,8))
OUTFIL INCLUDE=(135,1,CH,EQ,C'3'),
BUILD=(136,8,C',',80,6,C',',144,8,C',',152,8)
/*
|
|
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
| Code: |
1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 04:23 ON SAT
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(40,14,CH,EQ,C'STARTED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(135:SEQ=1,136:28,8,144:55,8)),
IFTHEN=(WHEN=GROUP,BEGIN=(40,12,CH,EQ,C'ENDED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(152:53,8))
OUTFIL INCLUDE=(135,1,CH,EQ,C'3'),
BUILD=(136,8,C',',80,6,C',',144,8,C',',152,8)
G RECORD TYPE IS F - DATA STARTS IN POSITION 1
|
I am getting this error in SPOOL when I am running the above sort |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
| what error? |
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Yes, what error?
Post the DFSORT ICE* messages. |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
I am getting only this info in SPOOL
| Code: |
ICE143I 0 BLOCKSET COPY TECHNIQUE SELECTED
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AN
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R10 - 04:23 ON SAT AU
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(40,14,CH,EQ,C'STARTED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(135:SEQ=1,136:28,8,144:55,8)),
IFTHEN=(WHEN=GROUP,BEGIN=(40,12,CH,EQ,C'ENDED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(152:53,8))
OUTFIL INCLUDE=(135,1,CH,EQ,C'3'),
BUILD=(136,8,C',',80,6,C',',144,8,C',',152,8)
ICE201I G RECORD TYPE IS F - DATA STARTS IN POSITION 1
ICE222A 0 33 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 134 BYTE LRECL FOR SORTOUT
ICE751I 0 C5-K51707 C6-K51707 C7-K51707 C8-K51707 E9-K51707 E7-K51707
ICE052I 3 END OF DFSORT
|
|
|
| Back to top |
|
 |
superk
Global Moderator

Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
| Code: |
| ICE222A 0 33 BYTE FIXED RECORD LENGTH IS NOT EQUAL TO 134 BYTE LRECL FOR SORTOUT |
By my calculations your OUTFIL BUILD statement is creating a 33-BYTE fixed-block output record. You're not trying to somehow override that in your JCL, are you? |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
My JCL is
| Code: |
//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=ABCD.SATS.PULL.TOOL.SARSRT,DISP=SHR
//SORTOUT DD DSN=ABCD.SATS.PULL.TOOL.SARSRT,DISP=OLD
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(40,14,CH,EQ,C'STARTED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(135:SEQ=1,136:28,8,144:55,8)),
IFTHEN=(WHEN=GROUP,BEGIN=(40,12,CH,EQ,C'ENDED - TIME'),
END=(65,15,CH,EQ,C'TOTAL CPU TIME='),
PUSH=(152:53,8))
OUTFIL INCLUDE=(135,1,CH,EQ,C'3'),
BUILD=(136,8,C',',80,6,C',',144,8,C',',152,8)
/*
|
SORTIN File DCB parameters
Organization . . . : PS
Record format . . . : FB
Record length . . . : 134
Block size . . . . : 1340
SORTOUT File DCB parameters
Organization . . . : PS
Record format . . . : FB
Record length . . . : 134
Block size . . . . : 27872 |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
When I am doing JSCAN, I am getting these errors.
| Code: |
E1 8 DSS10065E PARAMETER 'BEGIN' IS UNIDENTIFIED.
E2 8 DSS10065E PARAMETER 'END' IS UNIDENTIFIED.
E3 8 DSS10065E PARAMETER 'PUSH' IS UNIDENTIFIED.
E4 8 DSS10065E PARAMETER 'BEGIN' IS UNIDENTIFIED.
E5 8 DSS10065E PARAMETER 'END' IS UNIDENTIFIED.
E6 8 DSS10065E PARAMETER 'PUSH' IS UNIDENTIFIED.
|
|
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
do not trust jcl scanners to check <sort> control statements
while jcl syntax changes are <rare> not so for <sort> control statements
and jcl scanners are often behind
just run Your jcl to have the real sort check it' s own statements |
|
| Back to top |
|
 |
scorp_rahul23
New User

Joined: 06 May 2008 Posts: 96 Location: Delhi
|
|
|
|
It worked, I just change the record length of OUTPUT DSN.
One more thing, How can I include Header in that output.
I am getting output like
| Code: |
G529365A, .00, .07,09.01.53,09.01.58
G529365G, .00, .09,04.39.28,04.39.34
G529365J, .00, .08,12.04.25,12.04.30
|
But I want to add Header in this, Can someone guide me on this.
| Code: |
JOBNAME,CPUTIME,ELAPSED TIME,START TIME,END TIME
G529365A, .00, .07,09.01.53,09.01.58
G529365G, .00, .09,04.39.28,04.39.34
G529365J, .00, .08,12.04.25,12.04.30
|
|
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
scorp_rahul23,
You are only writing out 4 fields as per frank's job. But you show 5 header fields. So where is the 5th field coming from? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
scorp_rahul23,
If you want your output LRECL to be 134 and you want to add a HEADER, just use an OUTFIL statement like this:
| Code: |
OUTFIL REMOVECC,
INCLUDE=(135,1,CH,EQ,C'3'),
BUILD=(136,8,C',',80,6,C',',144,8,C',',152,8,134:X),
HEADER1=('the string you want for the header')
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|