Page 1 of 1

Formatting Input Using JCL ......!!

PostPosted: Thu Oct 30, 2014 12:29 pm
by mj025
HI all,

I have a input PS file that is in the following format that is
aaaaaaa aaaaaa  ssssssssss    9999999999
bbbbb bbbbb ssssssss      9999994555     
bbbbbbb bbbbbb ssssssssss    9999994556 
ccccccc cccccc ssssss        9999994557 


The output should look like
aaaaaaa aaaaaa   | ssssssssss   |   9999999999
bbbbb bbbbb       |  ssssssss     |  9999994555     
bbbbbbb bbbbbb |   ssssssssss  |  9999994556 
ccccccc cccccc    |   ssssss       | 9999994557


is this can be achivied by JCL.This can be done through Cobol Program approach also.I need a JCL approach if possible .............?


Thanks in advance

Code'd

Re: Formatting Input Using JCL ......!!

PostPosted: Thu Oct 30, 2014 12:51 pm
by mj025
This could be the formatted output .

AAAAAAA AAAAAA | SSSSSSSSSS  | 9999999999 9999
BBBBB B        | SSSSSSSS    | 9999994555     
BBBBBBB B      | SSSSSSSSSS  | 9999994556     
CCCCCCC CC     | SSSSSS      | 9999994557     

Re: Formatting Input Using JCL ......!!

PostPosted: Thu Oct 30, 2014 2:23 pm
by Aki88
Hello,

No, you can not achieve the requested o/p through 'JCL' as such; though you can run a utility/utilities through JCL to achieve the requested o/p.
One of the utilities you can try is DFSORT/SYNCSORT (depending on the product your shop supports).

If you choose to use DFSORT, and you know the column in which you need the pipes (example, column 16 and then 30 from the displays you've shared), you can use a simple OUTFIL BUILD statement to fulfill the requirement; have a look at the DFSORT programming guide (if you have DFSORT at your site) or search the forum for OUTFIL BUILD, there are innumerous examples explaining it.

Regards.

Re: Formatting Input Using JCL ......!!

PostPosted: Thu Oct 30, 2014 5:11 pm
by BillyBoyo
You need to re-show your input, within the Code tags to preserve spacing and use the Preview button so see what the post will look like, then Submit.

If your input is fixed, as Aki88 has said it is a simple BUILD (on INREC, OUTREC or OUTFIL) perhaps even an OVERLAY.

If your data starts in variable positions, you will need to PARSE.

Re: Formatting Input Using JCL ......!!

PostPosted: Tue Nov 04, 2014 11:29 am
by mj025
Hi,
thanx Aki88 and BillyBoyo for your replies
your correct Aki88 we can do that using Build,overlay for fixed length records.
But i don't know the lengths of each record it may vary,so as BillyBoyo said i has to do it using PARSE but don't know it's function read some IBM manuals
BillyBoyo please explain me PARSE for this input or any example if possible or any useful manuals etc...

Thanx

Re: Formatting Input Using JCL ......!!

PostPosted: Fri Nov 07, 2014 6:31 pm
by BillyBoyo
Sorry, missed this one.

You can find all the manuals here, choose the ones for your version of DFSORT: http://www-01.ibm.com/support/docview.wss?uid=isg3T7000080

There is a Getting Started Guide, and an extensive Application Programming Guide. Both of these will explain PARSE.

You will also find examples of PARSE if you search here.

If you get stuck, show what you've tried and the problem you are having, and someone will assist.