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
 
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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

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