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
 

 

Including Header with Column Names

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

Active User


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

PostPosted: Thu Aug 18, 2011 2:52 am    Post subject: Including Header with Column Names
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: 6967
Location: porcelain throne

PostPosted: Thu Aug 18, 2011 3:52 am    Post subject:
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 Moderator


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

PostPosted: Thu Aug 18, 2011 10:44 pm    Post subject:
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: 356
Location: New York

PostPosted: Fri Sep 09, 2011 1:17 am    Post subject: Reply to: Including Header with Column Names
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 Moderator


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

PostPosted: Fri Sep 09, 2011 2:19 am    Post subject:
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: 356
Location: New York

PostPosted: Fri Sep 16, 2011 12:29 am    Post subject:
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    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 Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
No new posts SQZ pipe delimited file with 1 column... Rick Silvers DFSORT/ICETOOL 6 Sun Nov 06, 2016 8:11 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Add system date inside of a PS file a... pramitdas DFSORT/ICETOOL 5 Sun Aug 28, 2016 12:06 am


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