Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Need to Initialize an empty flat file through Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to Initialize an empty flat file through Sort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Sep 27, 2013 7:20 pm    Post subject: Reply to: Need to Initialize an empty flat file through Sort
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    Post subject: Reply to: Need to Initialize an empty flat file through Sort
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Sep 27, 2013 7:40 pm    Post subject: Reply to: Need to Initialize an empty flat file through Sort
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: 1712
Location: UK

PostPosted: Fri Sep 27, 2013 8:24 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Fri Sep 27, 2013 9:30 pm    Post subject: Reply to: Need to Initialize an empty flat file through Sort
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 27, 2013 11:39 pm    Post subject: Reply to: Need to Initialize an empty flat file through Sort
Reply with quote

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

Site Director


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

PostPosted: Sat Sep 28, 2013 12:04 am    Post subject:
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    Post subject: Reply to: Need to Initialize an empty flat file through Sort
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    Post subject: Re: Reply to: Need to Initialize an empty flat file through
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us