Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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: 7315

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: 1922
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: 7315

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: 2504
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 VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
This topic is locked: you cannot edit posts or make replies. Comparing current time with the time ... arunsoods SYNCSORT 1 Mon Oct 30, 2017 4:07 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us