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 

how to strip first 8 characters in vb format file

 
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 Apr 04, 2005 6:01 am    Post subject: how to strip first 8 characters in vb format file Reply with quote

Hi,

I want to strip first 8 characters in a VB recfm file.
I have executed the following code
Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD DSN=DFE.DB20342A.TS02613A.LOAD.APR1,           
//            DISP=SHR                                       
//SORTOUT  DD DSN=DFE.DB20342A.TS02613A.LOAD.TEMP,DISP=OLD   
//          DISP=(NEW,CATLG,DELETE),                       
//            UNIT=SYSDA,                                     
//            SPACE=(CYL,(1,1),RLSE)                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                           
  OUTREC FIELDS=(9,145)                                     
//*       

but it is giving the error. Input file is VB and rec length =156. How should i give outrec fields data. i tried with 13 (vb starts with 5) and 152 also. should the output file also be VB file or i can copy into FB format file.

thanks in adavance.

nadh
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 Apr 04, 2005 7:18 am    Post subject: Reply with quote

Change your Sysin cards to the following . Since your input file is VB you need to use the parm CONVERT to copy into a FB file.

Code:

//SYSIN    DD * 
  SORT FIELDS=COPY
  OUTFIL CONVERT,
  OUTREC=(9,145)
/*       


Hope this helps...

Cheers

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 Apr 04, 2005 9:17 am    Post subject: Reply with quote

If i try like that it is giving the below error

SORT FIELDS=COPY,
OUTFILL CONVERT,
$
0 INVALID SORT OR MERGE STATEMENT OPERAND
OUTREC FIELDS=(9,145)


pls. help me out.

nadh
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 Apr 04, 2005 9:34 am    Post subject: Reply with quote

Nadh,

Take a closer look at your control cards. You had an extra L in the OUTFIL.
ie.
Quote:

OUTFILL


Remove the extra L and your job will run fine

Hope this helps...

Cheers

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 Apr 04, 2005 9:46 am    Post subject: Reply with quote

i executed with outfil it is giving the following error.

SORT FIELDS=COPY
OUTFIL CONVERT
OUTREC FIELDS=(13,145)
0 RECORD TYPE IS V - DATA STARTS IN POSITION 5
0 INCONSISTENT *OUTREC IFTHEN 0 REFORMATTING FIELD FOUND
3 END OF DFSORT


Pls. help me out.

nadh
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 Apr 04, 2005 9:58 am    Post subject: Reply with quote

nadh,

With outfil you only need OUTREC instead of OUTREC FIELDS

i.e
Code:

//SYSIN    DD * 
  SORT FIELDS=COPY
  OUTFIL CONVERT,
  OUTREC=(9,145)
/*       


Why don't you simply copy the control cards from my prior posts? You are missing a Comma after convert and you used OUTREC FIELDS in your latest control cards

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 Apr 04, 2005 10:10 am    Post subject: Reply with quote

It worked fine Kolusu,

Thank you very much

Regards
Nadh
Back to top
View user's profile Send private message Send e-mail
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Mon Apr 04, 2005 10:14 am    Post subject: Reply with quote

nadh,

The first 4 bytes in a VB file are the RDW. So when you say you want to strip the first 8 characters, it's not clear if you want to remove the RDW and the first 4 data bytes after the RDW, or remove the RDW and the first 8 data bytes after the RDW.

If you want go VB to VB and remove the first 4 data bytes after the RDW, you can use:

Code:

  OPTION COPY
  OUTREC FIELDS=(1,4,5:9)


If you want to go VB to VB and remove the first 8 data bytes after the RDW, you can use these DFSORT statements:

Code:

   OPTION COPY
   OUTREC FIELDS=(1,4,5:13)


If you want to go VB to FB and remove the first 4 data bytes (and the RDW), you can use these DFSORT statements:

Code:

  OPTION COPY
  OUTFIL VTOF,OUTREC=(9,148)

[/code]

If you want to go VB to FB and remove the first 8 data bytes (and the RDW), you can use these DFSORT statements:

Code:

  OPTION COPY
  OUTFIL VTOF,OUTREC=(13,144)

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


Joined: 08 Oct 2004
Posts: 192
Topics: 89

PostPosted: Mon Apr 04, 2005 10:47 am    Post subject: Reply with quote

Thank you.
Back to top
View user's profile Send private message Send e-mail
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