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

SyncSort's Sort Product, SyncTool for z/OS, SYNCINIT and SYNCLIST.
Previous topicNext topic

Topic Author
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 » Thu May 21, 2015 6:44 pm

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: 605
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars
Zodiac: Libra

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

Post by zprogrammer » Thu May 21, 2015 7:22 pm

Do you just need a plain copy to FB formatted Output file or do you need to alter the record length as well?


zprogrammer


Topic Author
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 » Fri May 22, 2015 11:47 am

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: 597
Joined: Wed Apr 23, 2014 8:45 pm

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

Post by nicc » Fri May 22, 2015 3:22 pm

Just do a COPY operation in your sort product, copying bytes 2 to 81 to the output.


Regards
Nic


Topic Author
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 » Tue May 26, 2015 1:58 pm

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: 605
Joined: Wed Nov 20, 2013 11:53 am
Location: Mars
Zodiac: Libra

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

Post by zprogrammer » Tue May 26, 2015 2:02 pm

Thanks for sharing the solution


zprogrammer


William Collins
Global Moderator
Global Moderator
Posts: 499
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 » Tue May 26, 2015 3:35 pm

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.



Previous topicNext topic

Return to “SyncSort, SyncTool, SyncGener.”