Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Converting VB to FB Using MVS

Status
Not open for further replies.

ks01

MIS
Aug 11, 2002
110
0
0
US
Hello …

I hope I am posting to the right forum and someone here can help.

I am trying to block a VB data set to FB, but the JCL I’m using (using both DFSORT and File-AID), but neither seems to perform the function I am looking for.

My input file is a variable length data set where the data starts in position 5 and ends in position 82. The RDW is written in bytes 1-4 of the record. Here is he sample format of my data:


Code:
   DATA 1             DATA 2             DATA 3             DATA 4             DATA 5             
BR*----------------*R*----------------*R*----------------*R*----------------*R*----------------*

The RDW (indicated as R in the example above), is after the first 82 bytes for 4 bytes, then the next set of data is written on the same record. There are 49 sets of data per record. I shortened the example above from 82 byte lengths.

Here is the JCL I’ve tried:

Code:
//S1     EXEC  PGM=SORT                               
//SYSOUT DD    SYSOUT=*                               
//SORTIN DD    DSN=MYINPUTFILE,       
//             DISP=SHR                               
//FBOUT  DD    DSN=MYOUTPUTFILE.FBOUT,
//             DISP=(NEW,CATLG,DELETE),               
//             UNIT=3390,SPACE=(CYL,(5,5))            
//SYSIN  DD    *                                      
  OPTION COPY                                         
  OUTFIL FNAMES=FBOUT,VTOF,OUTREC=(5,77)           
/*

I have also tried this approach:

Code:
//FASTEP  EXEC PGM=FILEAID,REGION=0M                   
//SYSPRINT DD  SYSOUT=*                                 
//SYSLIST  DD  SYSOUT=*                                 
//DD01     DD  DSN=MYINPUTFILE,
//             DISP=SHR
//DD01O    DD  DSN= MYOUTPUTFILE.FBOUT,
//             DISP=(,CATLG,DELETE),                    
//             UNIT=RESDA,SPACE=(CYL,(500,100),RLSE),   
//             DCB=(RECFM=FB,LRECL=48,BLKSIZE=480)      
//SYSIN    DD  *                                        
$$DD01 USER MOVE=(1,82,5),                              
            MOVE=(1,82,87),                             
            MOVE=(1,82,169),                            
            MOVE=(1,82,251),                            
            MOVE=(1,82,333),                            
            MOVE=(1,82,415),                            
            MOVE=(1,82,497),                            
            MOVE=(1,82,579),                            
            MOVE=(1,82,661),                            
            MOVE=(1,82,743),                            
            MOVE=(1,82,825),                            
            MOVE=(1,82,907), 
            MOVE=(1,82,989), 
            MOVE=(1,82,1071),
            MOVE=(1,82,1153),
            MOVE=(1,82,1235),
            MOVE=(1,82,1317),
            MOVE=(1,82,1399),
            MOVE=(1,82,1481),
            MOVE=(1,82,1563),
            MOVE=(1,82,1645),
            MOVE=(1,82,1727),
            MOVE=(1,82,1809),
            MOVE=(1,82,1891),
            MOVE=(1,82,1973),
            MOVE=(1,82,2055),
            MOVE=(1,82,2137),
            MOVE=(1,82,2219),
            MOVE=(1,82,2301),
            MOVE=(1,82,2383),
            MOVE=(1,82,2465),
            MOVE=(1,82,2547),
            MOVE=(1,82,2629),
            MOVE=(1,82,2711),
            MOVE=(1,82,2793),
            MOVE=(1,82,2875),           
            MOVE=(1,82,2957),           
            MOVE=(1,82,3039),           
            MOVE=(1,82,3121),           
            MOVE=(1,82,3203),           
            MOVE=(1,82,3285),           
            MOVE=(1,82,3367),           
            MOVE=(1,82,3449),           
            MOVE=(1,82,3531),           
            MOVE=(1,82,3613),           
            MOVE=(1,82,3695),           
            MOVE=(1,82,3777),           
            MOVE=(1,82,3859),           
            MOVE=(1,82,3941),WRITE=DD01O
/*

The last approach works for the first set of data, but it only seems to have written the last DATA 5 block to my output.
My end result would look something like:

Input file:

Code:
   DATA 1             DATA 2             DATA 3             DATA 4             DATA 5             
BR*----------------*R*----------------*R*----------------*R*----------------*R*----------------*

Output file:
Code:
Data 1 (record 1) on Record 1
Data 2 (record 1) on Record 2
Data 3 (record 1) on Record 3
Data 4 (record 1) on Record 4
Data 5 (record 1) on Record 5
Data ...
Data 49 (record 2) on Record 49

Advance to next record and repeat:

Data 1 (record 2) on Record 50
Data 2 (record 2) on Record 51
Data 3 (record 2) on Record 52
Data 4 (record 2) on Record 53
Data 5 (record 2) on Record 54
Data ...
Data 49 (record 2) on Record 99

Advance to next record and repeat:

Data 1 (record 3) on Record 100
Data 2 (record 3) on Record 101
Data 3 (record 3) on Record 102
Data 4 (record 3) on Record 103
Data 5 (record 3) on Record 104
Data ...
Data 49 (record 3) on Record 149

Continue until all records have been read.

I would appreciate any feedback or assistance anyone could provide.

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top