View previous topic :: View next topic
|
Author |
Message |
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi all,
I have an input CSV file.
It looks like
Code: |
AAAA,BBBB,CCCC,DDDD
EEEEEE,FF,GGGGGGG,H
II,JJJJJ,KKKKKK,LLLLLLL |
where the line " AAAA,BBBB,CCCC,DDDD" header and each field is of Pic X(10)
The oput put file Must be
Code: |
AAAA EEEEEE | II
BBBB FF | JJJJJ
CCCC GGGGGGG | KKKKKK
DDDD H | LLLLLLL |
can this be achieved thru JCL..... Please help me out in this |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Quote: |
can this be achieved thru JCL..... Please help me out in this |
Yes it can be achieved through JCL. Which program would you like the JCL to execute to achieve your results. SAS, REXX, maybe SORT can do this too. |
|
Back to top |
|
|
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi Expat,
it would be great if it is done using Sort. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
And which SORT product is installed at your site, DFSORT or SYNCSORT ? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Expat, you are giving expats a bad name. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
dbzTHEdinosauer wrote: |
Expat, you are giving expats a bad name. |
One has to make the effort sometimes |
|
Back to top |
|
|
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi,
can you provide it in both DFSORT and SYNCSORT..
Thanks in advance |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
sudharsan.soundararajan wrote: |
Hi,
can you provide it in both DFSORT and SYNCSORT..
Thanks in advance |
Why, just to save you the effort of finding out which sort product you use.
Asking for code is one thing that gets to me, especially without any admission or evidence of attempt.
What manuals have you looked at so far, What have you tried on your own and what were the results ? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
There's more here than meets the eye.
PARSE will get the fields in fixed positions. But the OP wants to go from a horizontal arrangement of the fields to a vertical arrangement of the fields. Note that the fields from the first input record are in the first output column, the fields from the second record are in the second output column and the fields from the third record are in the third output column.
Perhaps responders should make more of an effort to understand the problem before assuming a simple search will give the answer.
Sudharsan.S,
Do you always have only three records or can you have more than three records (what's the maximum number)? What is the RECFM and LRECL of the input file? Do you really need the | (OR) sign before the third output column? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Sorry, my bad |
|
Back to top |
|
|
sudharsan.soundararajan Warnings : 1 New User
Joined: 15 Oct 2008 Posts: 17 Location: Chennai
|
|
|
|
Hi Frank,
i saw a similar kind of code under the topic
Type_Description_Here ibmmainframes.com/viewtopic.php?t=37296
But my problem is the data fields keep on changing according to their length.
For example i have a Name field which may be 5chars or 25 chars.
Quote: |
Do you always have only three records or can you have more than three records (what's the maximum number)? |
yes i have totally 23 fields
Quote: |
What is the RECFM and LRECL of the input file? |
LRECL is 250 and RECFM is FB
Quote: |
Do you really need the | (OR) sign before the third output column?
|
yeah i need it inbetween every data record ( inbetween 2nd and 3rd, 3rd and 4th ..... )
Hi Expat,
i am trying with other similar kind of solution provided in the forum.. in my next post i will paste the result which i got, and the problems i am facing.
I have done with my requirement using a program, but i want to know whether it can be done thru a JCL. Sorry if i have made something wrong.
Thanks in Advance |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I have done with my requirement using a program, but i want to know whether it can be done thru a JCL |
No, JCL alone cannot do what you want - it can only execute programs.
These might be programs like the one you mention or some utility like the sort, file-aid, easytrieve, etc. Even if you use the jcl to execute some utility instead of your own compiled code, you still have to "program" the utility. And this code should be documented and promoted as though it were an own-code program. |
|
Back to top |
|
|
|