View previous topic :: View next topic
|
Author |
Message |
ksouren007
New User
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
|
|
|
|
Hi,
I would need to create only one record into a newly created empty file from previous step (FB, LRECL=80) with the below data.
Bytes 1-4 would be zeroes.
From 5 to 80 would be spaces.
Can I do that using sort INREC IFTHEN=(WHEN=INIT,OVERLAY=(....)) function?
Please advise.
Regards,
Souren |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
No, because there are no records on it.
How have you "created" it?
You can use OUTFIL HEADER1 (or TRAILER1). |
|
Back to top |
|
|
ksouren007
New User
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
|
|
|
|
I had created it using an IEFBR14 step before it.
But using header it worked in the single step. I just created a dummy sorting file of FB, LRECL=80
Then OUTFIl REMOVECC, HEADER1=(c'0000',76X) created a record. Thanks Bill!!
I know I could read the character zeroes as numeric later on but does HEADER support writing numeric zeroes at the first place. Just curious.
Regards,
Souren |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You don't need any DCB information in the JCL. DFSORT will provide that, and arrange the optimum blocking. You have created a fixed-length record of 80 bytes, so that how DFSORT will create the file if you don't specify DCB info, Then you've only got the "80" in one place (as 4+76).
I've never tried, so you can. +0,TO=ZD,LENGTH=4 or +0 with an EDIT of TTTT. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You could also simply set up a dataset with that record in it and copy it in each time using IEBGENER this doing away with the IEFBR14 step and reducing processing resources because copying an existing record should require less resource that generating one. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You are saying that reading one record and writing one record is faster than reading no records and writing one?
A SORT copy is faster than IEBGENER. Perhaps even with one record :-) |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You can do this with DITTO.... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
If the keeper of the keys alows . . .
One of my clients does not let anyone but sysprogs execute DITTO.
Mercy. |
|
Back to top |
|
|
ksouren007
New User
Joined: 30 Jun 2010 Posts: 85 Location: Toronto, ON
|
|
|
|
Bill,
Tried with OUTFIL REMOVECC, HEADER1=(+0,TO=ZD,LENGTH=4,76X) did not work out because of OUTFIL Syntax Error.
Anyways, the other earlier way out worked fine with my requirement.
Thanks for your help.
Regards,
Souren |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
ksouren007 wrote: |
I know I could read the character zeroes as numeric later on but does HEADER support writing numeric zeroes at the first place. Just curious.
Regards,
Souren |
You can create any numeric data with header or trailer but needs to be specified in HEX.
for ex if you want to have Packed decimal value of 0 for a length of 4 bytes then you can specify
Code: |
OUTFIL BUILD=(80X),REMOVECC,HEADER1=(X'0000000C')
|
|
|
Back to top |
|
|
|