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

Creating file having only headers


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Wed May 20, 2009 7:13 pm
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 Developer


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

PostPosted: Wed May 20, 2009 8:43 pm
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
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 Developer


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

PostPosted: Wed May 20, 2009 11:12 pm
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

Moderator Emeritus


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

PostPosted: Wed May 20, 2009 11:36 pm
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
Reply with quote

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

Moderator Emeritus


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

PostPosted: Thu May 21, 2009 9:51 am
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 Developer


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

PostPosted: Thu May 21, 2009 8:38 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top