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 

Copy Header & Trailer and records.

 
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
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Mon Sep 10, 2007 5:37 am    Post subject: Copy Header & Trailer and records. Reply with quote

Hi,

I have an input file which contains Header, Trailer and Data Records.
I can copy by sort using the following command.

Code:

SORT FIELDS=COPY                     
RECORD TYPE=V                       
OUTFIL FILES=01,                     
INCLUDE=(1,1,CH,EQ,c'0')           
OUTFIL FILES=02,                     
OUTREC=(1:1,4,C'000',8:5,33)
OUTFIL FILES=03,                     
INCLUDE=(1,1,CH,EQ,c'F')           


Here in OUTFIL Files=02 I should convert the records by appending 000 from 5th position in record. the output file is 48 length and input is 37. Though it copied records appended space for 11 characters. Is there any way to add records without appending space at the end.

Thanks
Nadh.
Back to top
View user's profile Send private message Send e-mail
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Mon Sep 10, 2007 6:06 am    Post subject: Reply with quote

nadh,

Appending spaces to the end of the record is by default.

Do u want any other character to be there instead of the spaces?

If you need not have any character after 37th byte, change the record length to
37 instead of 48.

Please let us know what exactly you are trying to achieve

Regards,
Vivek G
_________________
Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay)
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 10, 2007 6:10 am    Post subject: Reply with quote

Quote:

Here in OUTFIL Files=02 I should convert the records by appending 000 from 5th position in record. the output file is 48 length and input is 37. Though it copied records appended space for 11 characters. Is there any way to add records without appending space at the end.

nadh,

Change your control cards for files=02 with the following

Code:

 OUTFIL FILES=02,                     
 OUTREC=(1:1,4,C'000',8:5)


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Mon Sep 10, 2007 7:16 am    Post subject: Reply with quote

Hi Kolusu,

Its giving the below error

INCONSISTENT SORTOF02 IFTHEN 0 REFORMATTING FIELD FOUND

Code:

 SORT FIELDS=COPY                   
 OUTFIL FILES=01,                   
 INCLUDE=(1,1,CH,EQ,C'0')           
 OUTFIL FILES=02,                   
 OUTREC=(1:1,4,C'000',8:5)         
 OUTFIL FILES=03,                   
 INCLUDE=(1,1,CH,EQ,C'F')           


Thanks
Nadh
Back to top
View user's profile Send private message Send e-mail
nadh
Intermediate


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Mon Sep 10, 2007 7:19 am    Post subject: Reply with quote

Sorry missed file def.

Code:

//SORTOF01 DD DSN=&&TEMP1,UNIT=TEMP,DISP=(,PASS),                     
//            SPACE=(CYL,(1,1)),DCB=(RECFM=FB,LRECL=37,BLKSIZE=0)     
//SORTOF02 DD DSN=&&TEMP2,UNIT=TEMP,DISP=(,PASS),                     
//            SPACE=(CYL,(400,25)),DCB=(RECFM=FB,LRECL=37,BLKSIZE=0)   
//SORTOF03 DD DSN=&&TEMP3,UNIT=TEMP,DISP=(,PASS),                     
//            SPACE=(CYL,(1,1)),DCB=(RECFM=FB,LRECL=37,BLKSIZE=0)     
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Sep 10, 2007 7:36 am    Post subject: Reply with quote

nadh,

Is your input file a Variable block(VB) file or a fixed block (FB) file?

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Mon Sep 10, 2007 7:37 am    Post subject: Reply with quote

nadh,

Could you please provide the sysout message?

The error could be possibly of record length mismatch.

Retain the original record length (48 ) for SORTOF02 and run the job.

Regards,
Vivek G
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