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

Including Header with Column Names


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Thu Aug 18, 2011 2:52 am
Reply with quote

Hi,

I need to generate a file with 732 record length and I have to insert Column Names for each column. When I am providing Column values on the Header Section of the control card, columns are coming different rows instead of consecutively.

My Header in JCL:

Code:

//HDR1 DD *                                                       
 HEADER:JOBNAME:TEMP-NAME.xml:Y:,                                 
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt
Name,BusStrtNo,BusCityName,BusState


I am expecting output as below

Code:

BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrtName,BusStrtNo,BusCityName,BusState


But I am getting Ouptut as below:

Code:

BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt
Name,BusStrtNo,BusCityName,BusState


Please let me know where I am wrong.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Aug 18, 2011 3:52 am
Reply with quote

HDR1 is just an inline data stream, which means it is limited to 80 bytes.

you need to use a BUILD to create the 732 char record.
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 Aug 18, 2011 10:44 pm
Reply with quote

It's not clear if you have an existing file that you want to add headers to, or if you want to generate an output file with headers in some way. But if you want to use page headers, the DFSORT statements would be something like this:

Code:

  OPTION COPY                                                       
  OUTFIL HEADER2=('BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,',
   'EffStrtDate,BusStrtName,BusStrtNo,BusCityName,BusState')         



If you want more specific help, you need to provide more details on what exactly you're trying to do, an example of input and expected output, RECFM and LRECL, etc.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Fri Sep 09, 2011 1:17 am
Reply with quote

Thanks Frank. I want to add header on the top of the existing file. In other words, the single line header of 732 length should be on the top of the file.

I am using below cards for Header and data massaging.

Code:

//TOOLIN   DD *             
  COPY FROM(HDR2) TO(SRT1) 
  COPY FROM(IN) USING(CTL1)


Code:

//CTL1CNTL DD *                                                 
 SORT FIELDS=(1,22,CH,A)                                         
    OUTFIL FNAMES=(SRT1)                                         
    INREC IFTHEN=(WHEN=INIT,                                     
    BUILD=(1,22,JFY=(SHIFT=LEFT,LEAD=C'"',TRAIL=C'";',LENGTH=25),


I have many more BUILD statements.
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: Fri Sep 09, 2011 2:19 am
Reply with quote

If I understand it correctly, you want to create your heading from an FB/80 file that looks like this:

Code:

 HEADER:JOBNAME:TEMP-NAME.xml:Y:,                                   
BusTin,BusName,YrEst,NumEmp,SaleSize,BusEntCode,EffStrtDate,BusStrt 
Name,BusStrtNo,BusCityName,BusState                                 


and insert it before your input records.

If so, you can use a DFSORT/ICETOOL job like the following:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//HDR DD DSN=... header file (FB/80)
//IN DD DSN=...  input file (FB/732)
//**** OUT MUST BE A MOD OUTPUT DATA SET
//OUT DD DISP=MOD,DSN=...  output file (FB/732)
//TOOLIN DD *
RESIZE FROM(HDR) TO(OUT) TOLEN(732) USING(CTL1)       
SORT FROM(IN) TO(OUT) USING(CTL2)                     
//CTL1CNTL DD *                                       
  OPTION SKIPREC=1                                   
  OUTFIL FNAMES=OUT,BUILD=(1,732,SQZ=(SHIFT=LEFT))   
//CTL2CNTL DD *
  INREC IFOUTLEN=732,
   ...                     
  SORT FIELDS=(1,22,CH,A)                 
  OUTFIL FNAMES=OUT                       
/*
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 355
Location: New York

PostPosted: Fri Sep 16, 2011 12:29 am
Reply with quote

Thanks Frank. I was looking for Header on the top of the file with more than 80 record length.

I could achieve it using HEADER1 clause.

Code:

//SYSIN    DD *                                                     
 SORT FIELDS=(1,22,CH,A)                                             
    OUTFIL FNAMES=(SORTOUT),REMOVECC,                               
    HEADER1=(1:c'column1|',9:c'column2|',28:c'column3'| etc ...
)
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 How to load to DB2 with column level ... DB2 6
No new posts RC query -Time column CA Products 3
No new posts first column truncated in search result IBM Tools 13
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Capturing COBOL job and program names... All Other Mainframe Topics 2
Search our Forums:

Back to Top