IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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: 7309
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

Superior Member


Joined: 14 Mar 2007
Posts: 10872
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
www-01.ibm.com/support/docview.wss?uid=isg3T7000094
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: 8696
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 8
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top