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 copy a file from VBA to FB

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Fri Aug 04, 2006 7:29 pm    Post subject: How to copy a file from VBA to FB Reply with quote

Hi all,

I have tried to do with sort , but get error record format is mismach.

can you please advise.


thank you
Back to top
View user's profile Send private message
shekar123
Advanced


Joined: 22 Jul 2005
Posts: 528
Topics: 90
Location: Bangalore India

PostPosted: Sat Aug 05, 2006 2:40 am    Post subject: Reply with quote

js01,

Can you post the JCL code and the error message exactly what you are getting ?
_________________
Shekar
Grow Technically
Back to top
View user's profile Send private message
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Sat Aug 05, 2006 3:12 pm    Post subject: Reply with quote

sekhar,

below is the jcl
Code:

//STEP0200 EXEC PGM=SORT                         
//SYSOUT   DD SYSOUT=*                           
//SORTIN   DD DSN=XXXX.YYYYY.LISTING.VB,       
//            DISP=SHR                           
//SORTOUT  DD DSN=XXXX,YYYYY.LISTING.FB80, 
//            DISP=(NEW,CATLG,DELETE),           
//            DCB=(LRECL=80,RECFM=FB),           
//            SPACE=(CYL,(1,2),RLSE)             
//SYSIN DD *         
  SORT FIELDS=COPY   
/*

Error which i am getting is
Code:

WER276B  SYSDIAG= 9001, 485470, 485470, 435064                   
WER164B  9,908K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B     0 BYTES RESERVE REQUESTED, 2,036K BYTES USED         
WER146B  12K BYTES OF EMERGENCY SPACE ALLOCATED                   
WER108I  SORTIN   : RECFM=VBA  ; LRECL=  4109; BLKSIZE=  6233     
WER202A  SORTOUT  RECFM INCOMPATIBLE                             
WER110I  SORTOUT  : RECFM=FB   ; LRECL=      ; BLKSIZE=           
WER462I  OUTPUT LRECL DIFFERS FROM SORTOUT LRECL                 
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                     
WER449I  SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE                     



can you please help me
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Sat Aug 05, 2006 3:58 pm    Post subject: Reply with quote

js01,

Try this job

Code:

//STEP0100 EXEC PGM=SORT
//SYSOUT   DD SYSOUT=*
//SORTIN   DD DSN=XXXX.YYYYY.LISTING.VB,
//            DISP=SHR
//SORTOUT  DD DSN=XXXX,YYYYY.LISTING.FB80,
//            DISP=(NEW,CATLG,DELETE),
//            RECFM=FB,
//            SPACE=(CYL,(1,2),RLSE)
//SYSIN    DD *
  SORT FIELDS=COPY
  OUTFIL OUTREC=(6,80),CONVERT
/*


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
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Mon Aug 07, 2006 1:20 pm    Post subject: Reply with quote

it is working
Thank you verymuch Kolus.

Also van you please advise how to skip some statments like below

the input file is:

aaaaaaaaa
bbbbbbbbb
ppppppppp
yyyyyyyyy
eeeeeeeeee
uuuuuuuuu
zzzzzzzzzzz
xxxxxxxxxx


i want out put file should be;

uuuuuuuuu
zzzzzzzzzzz
xxxxxxxxxx

Note: we do not no howmany records are there before record 'eeeeeeeeee'


thank you
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Aug 07, 2006 1:32 pm    Post subject: Reply with quote

Quote:

Note: we do not no howmany records are there before record 'eeeeeeeeee'


Where does the string 'eeeeeeee' start? ie. pos in the file. what are the DCB parameters of the input and output files?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Mon Aug 07, 2006 2:53 pm    Post subject: Reply with quote

Kolusu,

The position of the mentioned record in file is 1 , input LRECL = 80 and out put LRECL=80

thank you
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Aug 07, 2006 3:13 pm    Post subject: Reply with quote

js01,

try this job. I assuming that you have only 1 EEEEEE record in the file and it always present in the file

Code:

//STEP0100 EXEC  PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
AAAAAAAAAA                                               
BBBBBBBBBB                                               
PPPPPPPPPP                                               
YYYYYYYYYY                                               
EEEEEEEEEE                                               
UUUUUUUUUU                                               
ZZZZZZZZZZ                                               
XXXXXXXXXX                                               
//SORTOUT  DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN    DD *                                         
  SORT FIELDS=COPY                                       
  OUTREC FIELDS=(1,10,SEQNUM,8,ZD,80:X)                 
  OUTFIL INCLUDE=(01,10,CH,EQ,C'EEEEEEEEEE'),           
  OUTREC=(2X,C'OPTION COPY,SKIPREC=',11,8,80:X)         
/*                                                       
//STEP0200 EXEC  PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
AAAAAAAAA                                               
BBBBBBBBB                                               
PPPPPPPPP                                               
YYYYYYYYY                                               
EEEEEEEEE                                               
UUUUUUUUU                                               
ZZZZZZZZZ                                               
XXXXXXXXX                                               
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD DSN=&T1,DISP=SHR                           
/*                                                       


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
js01
Beginner


Joined: 13 Oct 2005
Posts: 84
Topics: 32
Location: INDIA

PostPosted: Tue Aug 08, 2006 3:48 pm    Post subject: Reply with quote

Kolusu,

It is wokring fine
I have completed my job with your help.
to know for my knowledge if there is more than one record (EEEEEEEEE) ,do we need to modify the SYSIN on first step

thank you
Back to top
View user's profile Send private message
coolman
Intermediate


Joined: 03 Jan 2003
Posts: 283
Topics: 27
Location: US

PostPosted: Wed Aug 09, 2006 9:45 am    Post subject: Reply with quote

Js01,

If there's more than one record with 'EEEEEEE', then Kolusu's job would consider only the first EEEEEE record and copy all records below that - This means, if you have a file with 3 'EEEEE' records, you would still have 2 'EEEEEE' records that are below the first one
________
Windsor Transmission


Last edited by coolman on Sat Feb 05, 2011 1:46 am; edited 1 time in total
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Aug 09, 2006 11:30 am    Post subject: Reply with quote

Quote:

If there's more than one record with 'EEEEEEE', then Kolusu's job would consider only the first EEEEEE record and copy all records below that - This means, if you have a file with 3 'EEEEE' records, you would still have 2 'EEEEEE' records that are below the first one


Coolman,

Not exactly true. The job will abend if you have more than 1 EEEEEE record if you are using SYNCSORT with WER270A.

Code:

WER270A  OPTION STATEMENT  : DUPLICATE PARM FOUND


DFSORT will NOT abend but puts informational messages in the sysout
Code:

ICE002I 0 DUPLICATE OR CONFLICTING OPTION   STATEMENT   



Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities 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