MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Header and Trailer Records In File thru JCL

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Tue Jan 13, 2004 9:54 am    Post subject: Header and Trailer Records In File thru JCL Reply with quote

Hi ,
Firstly ...Thnks again to Kolusu & Mike ..I was able to create the Integrated File of Lrecl 480 by using the Blocksize trick Smile.

Now , I have a FB File and after its creation want to Add some records as Header (at the Top) .....and some as Trailer (at the bottom) of File. I am not sure if this has already been discussed on this board ..I did a quick search of couple of pages but didnt find any related stuff. Pls. help..I would not like to go the program route. Thnks. Vini.

Header:
//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),'OHIO'
// MSGLEVEL=(1,1),CLASS=Q

Trailer:
/*
//
//*EOF STOP
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 13, 2004 11:57 am    Post subject: Reply with quote

Vini,

Here's a DFSORT job that will do what you want

Code:

//S1 EXEC PGM=SORT
//SYSOUT    DD SYSOUT=*
//SORTIN    DD DSN=...  input file
//SORTOUT   DD DSN=...  output file
//SYSIN     DD  *
  OPTION COPY
  OUTFIL REMOVECC,
   HEADER1=('//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),''OHIO''',/,
            '// MSGLEVEL=(1,1),CLASS=Q'),
   TRAILER1=('/*',/,
             '//',/,
             '//*EOF STOP')
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Tue Jan 13, 2004 1:55 pm    Post subject: Reply with quote

Frank,

1) Can the Sortout file be kept same as the Sortin File ?

2) What does REMOVECC option mean ?

3) Got following error messages on execution ..... pls. help.. Vini.
$
ICE213A 0 INVALID OUTFIL STATEMENT OPERAND
HEADER1=('//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),''OHIO''',/,
$
ICE005A 0 STATEMENT DEFINER ERROR
'// MSGLEVEL=(1,1),CLASS=Q'),
$
ICE007A 1 SYNTAX ERROR
TRAILER1=('/*',/,
$
ICE005A 0 STATEMENT DEFINER ERROR
'//',/,
$

ICE007A 1 SYNTAX ERROR
'//*EOF STOP')
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 13, 2004 3:50 pm    Post subject: Reply with quote

Vini,

1) No, you cannot use the same data set for the SORTIN and SORTOUT file with COPY. We read/write to the input/output files concurrently, so using the same file can result in writing over the data we need to read. If you need to have the output in the original file, use a temporary data set for SORTOUT and then use another step to copy the temporary file back to the input file. Or you can do it in one step with DFSORT's ICETOOL by using two COPY operators (see below).

2) Without REMOVECC, you will get a carriage control character in the first byte of each output record and a RECFM of FBA. With REMOVECC, you will not get the carriage control character and the RECFM will be FB.

3) Well, you didn't show where the ICE213A is pointing, but I suspect it's pointing to REMOVECC. That would mean that you're very downlevel in DFSORT PTFs. REMOVECC was added with PTF UQ99331 (way back in March, 2002) and PTF UQ90053 (Feb, 2003) was added after that.

Ask your System Progammer to install DFSORT R14 PTF UQ90053 (it's free). That will get you up to the latest functional level.

In the meantime, you can use a DFSORT/ICETOOL job like the following without the REMOVECC parameter (the second COPY operator removes the carriage control character for your final output):

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG   DD SYSOUT=*
//DFSMSG    DD SYSOUT=*
//IN    DD DSN=...  input file
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD RECFM=FB,DSN=...  output file
//TOOLIN    DD  *
  COPY FROM(IN) USING(CTL1)
  COPY FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=T1,
   HEADER1=('//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),''OHIO''',/,
            '// MSGLEVEL=(1,1),CLASS=Q'),
   TRAILER1=('/*',/,
             '//',/,
             '//*EOF STOP')
/*
//CTL2CNTL DD *
* Remove carriage control character
  OUTREC FIELDS=(2,80)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Tue Jan 13, 2004 6:10 pm    Post subject: Reply with quote

Frank,

The ICETOOL worked for me Fine... UNTIL I tried to add a much needed 4th Record to the Headers .
Is there a limitation of just 3 Records ??? I hope not ! Pls let me know how I can get this in tooo. Thnks to all of you for your time. Vini.

Was Trying to add the following Headers
(line 3 & 4 are New ...4th is cause of error I believe .. when its commented out in JCL .. works fine) :

//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),'OHIO'
// MSGLEVEL=(1,1),CLASS=Q
//PROC EXEC LADTOH39
//GENSTEP.SYSUT1 DD *

Trailers were as they were before (3 lines).

Following was error message :
ICE000I 0 - CONTROL STATEMENTS FOR 5740-SM1, DFSORT REL 14.0 - 17:53 ON TU
OUTFIL FNAMES=T1,
HEADER1=('//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),''OHIO''',/
'// MSGLEVEL=(1,1),CLASS=Q',/,
'//PROC EXEC LADTOH39',/,
'//GENSTEP.SYSUT1 DD *')
TRAILER1=('/*',/,
$
ICE005A 0 STATEMENT DEFINER ERROR
'//',/,
$
ICE007A 1 SYNTAX ERROR
'//*EOF STOP')
$
ICE007A 1 SYNTAX ERROR

Also I did not understand the following of your earlier response to me
'Well, you didn't show where the ICE213A is pointing' ...?!
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 13, 2004 6:36 pm    Post subject: Reply with quote

Vini,

There's no limitation on the number of records you can insert with HEADERn or TRAILERn. Your syntax error is due to a missing comma after the new last line you added. My original lines were:

Code:

   ...
   HEADER1=('//UILADTOH JOB (3777,XXXXXXXXXX,XX,XXX),''OHIO''',/,
            '// MSGLEVEL=(1,1),CLASS=Q'),
   TRAILER1=('/*',/,
   ...


Notice that each line ends with a comma to indicate continuation of the OUTFIL statement. You have:

Code:

     '//GENSTEP.SYSUT1 DD *')
  TRAILER1=('/*',/,


You're missing the comma on the //GENSTEP line so it erroneously ends the OUTFIL statement. You need the following to continue to the TRAILER1 line:

Code:

     '//GENSTEP.SYSUT1 DD *'),
  TRAILER1=('/*',/,


As for my comment about the ICE213A pointer, you showed:

$
ICE213A 0 INVALID OUTFIL STATEMENT OPERAND

The $ is below the parameter that was in error, but you didn't show that line.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Tue Jan 13, 2004 6:47 pm    Post subject: Reply with quote

Frank ,
Thanks for Debugging it for me Smile. I wouldnt have caught that one.

So long I was focussed on getttin the File done. Now I would like to know a little more around some facts that you mentioned of before.

The REMOVECC you said was mainly about the Carraige Control character. When does the need arise for these carriage control chars if ever ?!! Also I am not clear about the differences between a FB and FBA file format.

vini.
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Jan 13, 2004 7:43 pm    Post subject: Reply with quote

The A in FBA and VBA is for ANSI carriage control (there's also an M for machine carriage control). The carriage control characters appear in the first column of an FBA file or in the fifth column of a VBA file (after the 4-byte RDW) and give commands to the printer. For example, an ANSI carriage control character of '1' says to eject a page. When you create a report using OUTFIL (e.g. HEADERn, TRAILERn, etc), you get A in the RECFM and carriage control characters by default and the LRECL is increased by 1. This is a throwback to when most output went to printers. You can actually see these carriage control characters on your screen if you browse the OUTFIL output (you may have to shift over one character to see them).

I added REMOVECC to OUTFIL for those cases when you don't want the carriage control characters or A in the RECFM or 1 added to the LRECL. With REMOVECC, the carriage control characters are actually added to the records internally, but are then removed before the records are written to the OUTFIL data set. The RECFM and LRECL of the OUTFIL data set are set as if there are were no carriage control characters.

Note that the DISPLAY and OCCUR operators of DFSORT's ICETOOL also use carriage control characters for the report (LIST) data set.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vini
Intermediate


Joined: 12 Jan 2004
Posts: 240
Topics: 48
Location: Maryland

PostPosted: Tue Jan 13, 2004 11:10 pm    Post subject: Reply with quote

Thanks a LOT for All the Info & Help !

Vini.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group