IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Copy variable length input file to a standard output file


 
IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: :: View next topic  
Author Message
santoshks0611

New User


Joined: 18 Apr 2013
Posts: 10
Location: India

PostPosted: Fri Apr 19, 2013 10:33 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Fri Apr 19, 2013 11:41 am
Reply with quote

You have another binary field as well.

Look at PARSE. Examples here and in the manual.
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Fri Apr 19, 2013 2:01 pm
Reply with quote

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 icon_evil.gif

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
Use [URL] BBCode for Links
on how to process CSV data
Back to top
View user's profile Send private message
santoshks0611

New User


Joined: 18 Apr 2013
Posts: 10
Location: India

PostPosted: Fri Apr 19, 2013 3:09 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8568
Location: Dubuque, Iowa, USA

PostPosted: Fri Apr 19, 2013 3:20 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Apr 20, 2013 12:05 am
Reply with quote

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
View user's profile Send private message
santoshks0611

New User


Joined: 18 Apr 2013
Posts: 10
Location: India

PostPosted: Mon Apr 22, 2013 10:34 am
Reply with quote

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. icon_biggrin.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Apr 22, 2013 10:09 pm
Reply with quote

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. icon_biggrin.gif


Well had you been courteous and polite upfront, you would have got a better answer even before I got in.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts How to find which file contains my se... DFSORT/ICETOOL 6
No new posts IGZ0035S THERE WAS AN UNSUCCESSFUL OP... COBOL Programming 3
No new posts Hex Value - vb file replace old date ... DFSORT/ICETOOL 14
No new posts Related to using a file in comparison JCL & VSAM 7

Back to Top