Can we copy a FBA file to FB file using a JCL?

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Post Reply
Munnalal
New Member
Posts: 8
Joined: Mon Sep 15, 2014 8:52 am

Can we copy a FBA file to FB file using a JCL?

Post by Munnalal »

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.
zprogrammer
Global Moderator
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?

Post by zprogrammer »

Do you just need a plain copy to FB formatted Output file or do you need to alter the record length as well?
zprogrammer
Munnalal
New Member
Posts: 8
Joined: Mon Sep 15, 2014 8:52 am

Re: Can we copy a FBA file to FB file using a JCL?

Post by Munnalal »

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.
nicc
Global Moderator
Global Moderator
Posts: 691
Joined: Wed Apr 23, 2014 8:45 pm

Re: Can we copy a FBA file to FB file using a JCL?

Post by nicc »

Just do a COPY operation in your sort product, copying bytes 2 to 81 to the output.
Regards
Nic
Munnalal
New Member
Posts: 8
Joined: Mon Sep 15, 2014 8:52 am

Re: Can we copy a FBA file to FB file using a JCL?

Post by Munnalal »

Hi,

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)
 /*
//*
zprogrammer
Global Moderator
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?

Post by zprogrammer »

Thanks for sharing the solution
zprogrammer
William Collins
Global Moderator
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?

Post by William Collins »

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.
Post Reply

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

Register

Sign in

Return to “SyncSort, SyncTool, SyncGener.”