Can we copy a FBA file to FB file using a JCL?
Can we copy a FBA file to FB file using a JCL?
Hi All,
I have a file which is in FBA format. It is a dataset of length 81. Now my application is modified and it would need a file with FB format. Can you please tell me if I want to copy the data into the FB file how can I do that?
Thanks.
I have a file which is in FBA format. It is a dataset of length 81. Now my application is modified and it would need a file with FB format. Can you please tell me if I want to copy the data into the FB file how can I do that?
Thanks.
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
Re: Can we copy a FBA file to FB file using a JCL?
Do you just need a plain copy to FB formatted Output file or do you need to alter the record length as well?
zprogrammer
Re: Can we copy a FBA file to FB file using a JCL?
THanks for the reply.
If you can suggest both it will help in the long run. I have not thought that I could get 81 as lrecl too. As of now, I need a LRECL=80 and RECFM=FB.
If you can suggest both it will help in the long run. I have not thought that I could get 81 as lrecl too. As of now, I need a LRECL=80 and RECFM=FB.
Re: Can we copy a FBA file to FB file using a JCL?
Just do a COPY operation in your sort product, copying bytes 2 to 81 to the output.
Regards
Nic
Nic
Re: Can we copy a FBA file to FB file using a JCL?
Hi,
I have used this JCL:
I have used this JCL:
Code: Select all
//STEP01 EXEC PGM=SORT
//SORTIN DD DSN=MY.FILE,...FBA 81
//SORTOUT DD DSN=OUT.FILE,RECFM=FB ... FB=80
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(1:2,81)
/*
//*
-
- Global Moderator
- Posts: 588
- Joined: Wed Nov 20, 2013 11:53 am
- Location: Mars
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Can we copy a FBA file to FB file using a JCL?
Code: Select all
//DROPBYTE EXEC PGM=SORT
//SORTIN DD DSN=MY.FILE,...FBA 81
//SORTOUT DD DSN=OUT.FILE,RECFM=FB and don't specify LRECL.
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(2,80)
OUTREC holds no particular power over INREC in this case. FIELDS is "overloaded", BUILD is not, they are synonymous, so use of BUILD for new code is clearer.
You used starting column of 1:. This is the default for a BUILD (so also for FIELDS) so is unnecessary.
You used a length of 81, although the length of your data is 80. You got away with this (at some point you may get a S0C4 out-of-the-blue) because you specified an LRECL in the JCL. If you don't use an LRECL with DISP=NEW, SORT will supply the correct (from your control cards) LRECL automatically.
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute