IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Converting multiple VB files to FB files in single step


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Viswanath Reddy

New User


Joined: 08 Aug 2016
Posts: 2
Location: INDIA

PostPosted: Mon Aug 08, 2016 11:49 pm
Reply with quote

Hi Everyone,

I am trying to convert N no.of files from VB to FB in single step but I am not finding right answer. Is any suggestions on this question

Thanks & Regards,
Viswanath Reddy Y
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Aug 09, 2016 12:12 am
Reply with quote

I would write a program that does dynamic allocation of input and output data sets, taking in a list of input and output DSNs. Other sempai may offer other solutions; in particular, a *Sort maven as such Mr. Woodger may have a *Sort solution.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Aug 09, 2016 1:35 am
Reply with quote

JCL does not have any looping / go to structures. Program is the best choice also look INTRDR to trigger multiple jobs for each file.
Back to top
View user's profile Send private message
Viswanath Reddy

New User


Joined: 08 Aug 2016
Posts: 2
Location: INDIA

PostPosted: Tue Aug 09, 2016 8:58 am
Reply with quote

I tried few codes it doesn't work well but I got to know that if it is in REXX we can do . I don't have any idea about REXX .If anyone find an answer(even if it is in REXX also) please post it here
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3053
Location: NYC,USA

PostPosted: Tue Aug 09, 2016 9:48 am
Reply with quote

you already have two solutions given so what is that you don't understand? what have you tried ? what doesn't work?
Back to top
View user's profile Send private message
Abid Hasan

New User


Joined: 25 Mar 2013
Posts: 88
Location: India

PostPosted: Tue Aug 09, 2016 10:52 am
Reply with quote

Hello Viswanath,

The query raised is a little vague, also we donot know what all you've already tried that 'did not work'.
A few quick questions that come to mind on reading the post:
a. Are all the 'N' VB datasets having same RECL, or are they different?
b. Will the programmer 'be aware' of the input LRECL or they can vary depending upon every run?
c. How does the programmer choose the output LRECL for any of the input?

Either way, if you choose DFSORT to do this, a quick solution with a bit of coding, can be rigged up as below (this is but one of many ways):
1. Have the list of input VB DS in a PS dataset
2. Use this DS as input and generate a dynamic JCL which uses OUTFIL VTOF function of *SORT; again this can be done by using multiple SORT steps or a single ICETOOL 'COPY FROM(IN) TO(OUT) USING(CTL)' step wherein, data in 'CTL' will remain constant, 'COPY FROM' statements will depend on how many datasets are to be copied.
3. Route the above output to INTRDR.
4. In case LRECL for the VB DS can vary, save the LISTDS info of all the datasets in a PS dataset; trim this data to group DSN and LRECL.
5. Use the aforementioned DFSORT JCL build to build the requisite COPY JCL using the info obtained in point '4'; and route the output to INTRDR.

A similar logic can be used in case of REXX; but there again, YOU will have to devise a solution to handle output LRECL.
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2023
Location: USA

PostPosted: Fri Aug 12, 2016 3:08 am
Reply with quote

FILEAID can do the job

Code:
//FILECOPY EXEC PGM=FILEAID                       
//SYSPRINT  DD SYSOUT=*                           
//*                           
//* INPUT DATA FILES                             
//DD01      DD DISP=SHR,DSN=&SYSUID..INPUT1       
//DD02      DD DISP=SHR,DSN=&SYSUID..INPUT2       
//DD03      DD DISP=SHR,DSN=&SYSUID..INPUT3       
//* OUTPUT DATA FILES                             
//DD01O     DD DISP=(NEW,PASS),                   
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
//             DSN=&&OUTFILE1                     
//DD02O     DD DISP=(NEW,PASS),                   
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
//             DSN=&&OUTFILE2                     
//DD03O     DD DISP=(NEW,PASS),                   
//             DCB=(RECFM=FB,LRECL=80,BLKSIZE=0),
//             DSN=&&OUTFILE3                     
//*                                               
//SYSIN    DD  *                                 
$$DD01  COPY                                     
$$DD02  COPY                                     
$$DD03  COPY                                     
//* 


Confirmation of results: RECFM=VB --> RECFM=FB
Code:

                                                                               
DD01     DSN=$USER.INPUT1 OPENED AS PS,                         
             RECFM=VB,LRECL=300,BLKSIZE=27968,VOL=STGA88                       
DD01O    DSN=SYS16224.T172619.RA000.#123456.R0188163 OPENED AS PS,             
             RECFM=FB,LRECL=80,BLKSIZE=80,VOL=WRKT0M                           
$$DD01  COPY                                                                   
ABOVE FUNCTION ENDED ON NORMAL EOD                                       RC=0 
  RECORDS-READ=15,COPIED=15                                                   
                                                                               
15 RECORDS WRITTEN TO DD01O-SYS16224.T172619.RA000.#1233456.R0188163           
                        VOL=WRKT0M                                             

DD02     DSN=$USER.INPUT2 OPENED AS PS,                         
             RECFM=VB,LRECL=300,BLKSIZE=27968,VOL=STGA88                       
DD02O    DSN=SYS16224.T172619.RA000.#123456.R0188164 OPENED AS PS,             
             RECFM=FB,LRECL=80,BLKSIZE=80,VOL=WRKT0M                           
$$DD02  COPY                                                                   
ABOVE FUNCTION ENDED ON NORMAL EOD                                       RC=0 
  RECORDS-READ=15,COPIED=15                                                   
                                                                               
15 RECORDS WRITTEN TO DD01O-SYS16224.T172619.RA000.#1233456.R0188164           
                        VOL=WRKT0M                                             


DD03     DSN=$USER.INPUT3 OPENED AS PS,                         
             RECFM=VB,LRECL=300,BLKSIZE=27968,VOL=STGA88                       
DD03O    DSN=SYS16224.T172619.RA000.#123456.R0188165 OPENED AS PS,             
             RECFM=FB,LRECL=80,BLKSIZE=80,VOL=WRKT0M                           
$$DD03  COPY                                                                   
ABOVE FUNCTION ENDED ON NORMAL EOD                                       RC=0 
  RECORDS-READ=15,COPIED=15                                                   
                                                                               
15 RECORDS WRITTEN TO DD01O-SYS16224.T172619.RA000.#1233456.R0188165           
                        VOL=WRKT0M                                             

Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top