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
 

 

Creating file having only headers

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Wed May 20, 2009 11:01 am    Post subject: Creating file having only headers
Reply with quote

I want to create a file with entering only the header value and positioning it as per the layout(400)..for 3 fields.

eg..

Emp_Name Emp_number Emp_SSN

Can this be accomplished using easytrieve or dfsort.

Can anyone help?
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: Wed May 20, 2009 7:13 pm    Post subject:
Reply with quote

Hello,

You need to post a better example of what you want to do. . .

What typically works best is to show some sample "input" and the output you want from that sample input.

Also, mention the recfm and lrecl.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 20, 2009 8:43 pm    Post subject:
Reply with quote

And give the starting position, length and format of each relevant field.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Wed May 20, 2009 10:50 pm    Post subject:
Reply with quote

Actually there is no input files. I have to create a file with only headers like emp-no, emp-name, ssn of LRECL 400. later i will merge this file with other file having some records of LRECL 300.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed May 20, 2009 11:12 pm    Post subject:
Reply with quote

you can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=SORT
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
//SORTOUT DD DSN=...  output file (FB/400)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,NODETAIL,
    BUILD=(400X),
    HEADER1=(1:'Emp_Name',13:'Emp_number',30:'Emp_SSN',400:X)
/*


Quote:
I have to create a file with only headers like emp-no, emp-name, ssn of LRECL 400. later i will merge this file with other file having some records of LRECL 300.


Why would you create a header file with LRECL=400 to merge with anoter file of LRECL=300? Why wouldn't you create the header file with LRECL=300?
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: Wed May 20, 2009 11:36 pm    Post subject:
Reply with quote

Hello,

You might also consider creating the header only 1 time into a permanent file/member and then concatenating it in front of the data file when needed.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Thu May 21, 2009 8:08 am    Post subject: Reply to: Creating file having only headers
Reply with quote

the record layout difference is because the header length..
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: Thu May 21, 2009 8:57 am    Post subject:
Reply with quote

Hello,

Quote:
the record layout difference is because the header length..
What reason is there for the header to be other than the data length?

If the data is 300 and the header far less, why define a 400-byte header?

Someone needs to review what you are doing and possibly modify this. As you have described, there will be problems trying to use the 400-byte header in the same "input" as the 300-byte data. Both are fixed length, but you describe different lengths.
Back to top
View user's profile Send private message
rkarthik22

New User


Joined: 18 Apr 2009
Posts: 47
Location: India

PostPosted: Thu May 21, 2009 9:40 am    Post subject: Reply to: Creating file having only headers
Reply with quote

yeah....i Understood the usage of header here. is there any way to merge two files having diff LRECL..

One is having only headers with 500 bytes and other with valid records of 512 bytes
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: Thu May 21, 2009 9:51 am    Post subject:
Reply with quote

Hello,

The data lengths are a moving target. . . . and i'm confused icon_confused.gif

If the data records are 512 bytes, i suggest you make the header 512 also.

What reason has been given to create the header a different length than the data records?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu May 21, 2009 8:38 pm    Post subject:
Reply with quote

In order to merge two RECFM=FB files having different LRECLs, you must pad the shorter one to the length of the longer one, or truncate the longer one to the length of the shorter one. You could do this in one step using DFSORT's ICETOOL and a MOD output data set.
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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 How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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