|
View previous topic :: View next topic
|
| Author |
Message |
santoshks0611
New User
Joined: 18 Apr 2013 Posts: 10 Location: India
|
|
|
|
Hi,
I have an input file in this format,
| Code: |
"00000",1,"BASEDATA","2000-01-01-08.00.00.000000",,,
"00030",4,"BASEDATA","2000-01-01-08.00.00.000000",,"00000",1
"00100",10,"BASEDATA","2000-01-01-08.00.00.000000","BF1220Retrieve ","00100",1
|
I have to convert this data such that it matches the below copybook,
| Code: |
05 :PFX:-KEY.
10 MENU-ID PIC X(05).
10 MENU-SEQ-NUM PIC S9(04) BINARY.
05 PREV-UPDT-USER-ID PIC X(08).
05 PREV-UPDT-TS PIC X(26).
05 BPF-ID PIC X(30).
05 PARNT-MENU-ID PIC X(05).
05 PARNT-MENU-SEQ-NUM PIC S9(04) BINARY.
05 FILLER PIC X(20).
|
Here i have removed the double quotes and comma using below control cards,
| Code: |
OUTREC FINDREP=(IN=C'"',OUT=C'')
OUTREC FINDREP=(IN=C',',OUT=C'')
|
But I am not able to move the variable length input sequene num in the input file to a fixed length in output file using DFSORT or ICETOOL commands. I know this is easy in COBOL Read. But I wanted to know if this is possible using SORT utilitiy. Kinldy help me create the control card asap.
Thanks & Regards,
Santosh |
|
| Back to top |
|
 |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You have another binary field as well.
Look at PARSE. Examples here and in the manual. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
| Quote: |
| Kinldy help me create the control card asap. |
ASAP is an acronym that lowers Your benevolence factor and the willingness of people to help You
remember... we reply on our own time,
what makes You think that Your time is more valuable than our
if You have time constraints a forum is not the best place to ask for help
look here
www-01.ibm.com/support/docview.wss?uid=isg3T7000094
on how to process CSV data |
|
| Back to top |
|
 |
santoshks0611
New User
Joined: 18 Apr 2013 Posts: 10 Location: India
|
|
|
|
enrico-sorichetti: I did not mean that my time is more valuable than any others. I was in a hurry today. I just wanted some quict tips. I will make sure that I will not use it again.
Thanks for your link. It has a lot of DFSORT tricks and examples. |
|
| Back to top |
|
 |
Robert Sample
Global Moderator

Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
| Terms like "ASAP" and "urgent" should NEVER be used on a forum. The responses on a forum are voluntary and based on when people have the time to respond, NOT on some arbitrary schedule you have. If the problem is so urgent, you either need to solve it yourself or have your management hire a consultant to assist you. |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
santoshks0611,
Use the following control cards.
| Code: |
//SYSIN DD *
OPTION COPY
INREC FINDREP=(INOUT=(C'"',C''))
OUTREC PARSE=(%01=(ENDBEFR=C',',FIXLEN=05),
%02=(ENDBEFR=C',',FIXLEN=05),
%03=(ENDBEFR=C',',FIXLEN=08),
%04=(ENDBEFR=C',',FIXLEN=26),
%05=(ENDBEFR=C',',FIXLEN=30),
%06=(ENDBEFR=C',',FIXLEN=05),
%07=(ENDBEFR=C',',FIXLEN=05)),
BUILD=(%01,
%02,UFF,BI,LENGTH=2,
%03,
%04,
%05,
%06,
%07,UFF,BI,LENGTH=2,
20X)
//* |
|
|
| Back to top |
|
 |
santoshks0611
New User
Joined: 18 Apr 2013 Posts: 10 Location: India
|
|
|
|
Thanks a lot Skolusu.
The control card given by you did my job. I had actually written a program for the same. But this one is a faster and much efficient way for it. Thanks once again for all your responses.  |
|
| Back to top |
|
 |
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
| santoshks0611 wrote: |
Thanks a lot Skolusu.
The control card given by you did my job. I had actually written a program for the same. But this one is a faster and much efficient way for it. Thanks once again for all your responses.  |
Well had you been courteous and polite upfront, you would have got a better answer even before I got in. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|