Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Copy variable length input file to a standard output file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Copy variable length input file to a standard output file
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7225

PostPosted: Fri Apr 19, 2013 11:41 am    Post subject: Reply to: Copy variable length input file to a standard outp
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Fri Apr 19, 2013 2:01 pm    Post subject: Reply to: Copy variable length input file to a standard outp
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
http://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    Post subject:
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: 7908
Location: Bellevue, IA

PostPosted: Fri Apr 19, 2013 3:20 pm    Post subject:
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    Post subject: Reply to: Copy variable length input file to a standard outp
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 5 Fri Dec 02, 2016 9:47 am
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us