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

Need to Initialize an empty flat file through Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Sep 27, 2013 6:57 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 27, 2013 7:20 pm
Reply with quote

No, because there are no records on it.

How have you "created" it?

You can use OUTFIL HEADER1 (or TRAILER1).
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Fri Sep 27, 2013 7:31 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 27, 2013 7:40 pm
Reply with quote

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

Global Moderator


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

PostPosted: Fri Sep 27, 2013 8:24 pm
Reply with quote

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Sep 27, 2013 9:30 pm
Reply with quote

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

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 27, 2013 11:39 pm
Reply with quote

You can do this with DITTO....
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 28, 2013 12:04 am
Reply with quote

If the keeper of the keys alows . . .

One of my clients does not let anyone but sysprogs execute DITTO.

Mercy.
Back to top
View user's profile Send private message
ksouren007

New User


Joined: 30 Jun 2010
Posts: 85
Location: Toronto, ON

PostPosted: Mon Sep 30, 2013 5:32 pm
Reply with quote

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Oct 01, 2013 1:09 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top