MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem when converting the Input file to mainframe.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Sun Jun 29, 2008 2:23 am    Post subject: Problem when converting the Input file to mainframe. Reply with quote

Hi All,

I want to convert the customer
Back to top
View user's profile Send private message
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Sun Jun 29, 2008 9:41 am    Post subject: Reply with quote

The input record structure are below. In the input file, any field may have spaces.
Code:

01  A-INPUT-RECORD.                                       
    05  A-Field-1                 PIC X(05)       VALUE SPACES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-2                PIC 9(06).9(05) VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-3                PIC X(08)       VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-4                PIC X(08)       VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-5                PIC 9(06).9(05) VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-6                PIC X(08)       VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-7                PIC 9(06).9(05) VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-8                PIC X(08)       VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-9                PIC 9(06).9(05) VALUE ZEROES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-10               PIC X(08)       VALUE SPACES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-11               PIC X(30)       VALUE SPACES.
    05  FILLER                    PIC X(01)       VALUE SPACES.
    05  A- Field-12               PIC X(11)       VALUE SPACES.
Back to top
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Jun 29, 2008 11:54 pm    Post subject: Reply with quote

Well, as you have posted this in the TSO/ISPF forum as opposed to the Utilities forum I presume you are wanting to know how to reformat your data using a rexx program or clist.

By far the easiest is to use Rexx. You can use PARSE to split your input record into its constituent parts and FORMAT or RIGHT or LEFT to make those parts the correct length whilst concatenating them back into one record for rewriting. And your best bet is to use a CSV file out of Excel so that you can parse on the comma or semi-colon (whichever is used to seperate the fields).
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
jyoung
Beginner


Joined: 10 Nov 2005
Posts: 36
Topics: 2
Location: Flint, MI

PostPosted: Mon Jun 30, 2008 6:03 am    Post subject: Reply with quote

I use Active States Perl on my Windows PC to extract the cells from an Excel spread sheet and place them in a text file formatted to what I need. Here is a link:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/ActivePerl-Winfaq12.html#extract_cells
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jun 30, 2008 10:26 am    Post subject: Reply with quote

sabarisavi,

Save the excel file as .CSV (comma separated file) , FTP it and you can use DFSORT to Parse and create the file in the layout that your cobol program requires.

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Mon Jun 30, 2008 10:42 am    Post subject: Reply with quote

Nic and Jyoung, Thanks for your response.

I'm looking for solution, but not using any technology based like Rexx / PARSE. Since, this task will handle by customer. So, they are looking for a simple solution.

Client will send the PRN file. (Which it will open by text format)

I
Back to top
View user's profile Send private message
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Mon Jun 30, 2008 10:46 am    Post subject: Reply with quote

Thanks Kolusu, I think your suggestion make sense. Could you please brief. If i have any spaces in the input field, how can i check?
Back to top
View user's profile Send private message
jyoung
Beginner


Joined: 10 Nov 2005
Posts: 36
Topics: 2
Location: Flint, MI

PostPosted: Mon Jun 30, 2008 10:54 am    Post subject: Reply with quote

The problem with saving it as a PRN file is that unless each column in the spread sheet is set to left or right justify you will have problems when you have a mixture of numbers in one cell in the column and letters in another cell in the same column. Excel will left justify the letters and right justify the numbers. Koluso's solution sounds like a better idea if my Perl option will not work.
Back to top
View user's profile Send private message
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Mon Jun 30, 2008 1:14 pm    Post subject: Reply with quote

Kolusu,

Could you please advise that how we can do thru DFSORT to Parse and create the cobol program require file? Since i read couple of Parse example but couldnt be able to build perfect SORT code.

Please help me. Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Jun 30, 2008 2:36 pm    Post subject: Reply with quote

sabarisavi,

Here is a sample DFSORT JCL for the first few fields. I coded up to A- Field-5 .You can use this as template and code for the rest of the fields

Code:

//STEP0100 EXEC PGM=ICEMAN                                     
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                               
20041,000000.75000,20080701,99991231,000000,00000 000000.00000,
20042,000001.25000,20080701,99991231,000000.00000,000000.00000,
50201,000007.50000,20080701,99991231,000000.00000,000000.00000,
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OPTION COPY                                                 
  INREC PARSE=(%00=(ENDBEFR=X'6B',FIXLEN=5),                   
               %01=(ENDBEFR=X'6B',FIXLEN=12),                 
               %02=(ENDBEFR=X'6B',FIXLEN=08),                 
               %03=(ENDBEFR=X'6B',FIXLEN=08),                 
               %04=(ENDBEFR=X'6B',FIXLEN=12),                 
               %05=(ENDBEFR=X'6B',FIXLEN=12)),                 
       BUILD=(%00,X,%01,X,%02,X,%03,X,%04,X,%05)               
/*                                                             


Hope this helps....

Cheers
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sabarisavi
Beginner


Joined: 25 Apr 2008
Posts: 30
Topics: 6
Location: Ashburn, VA

PostPosted: Tue Jul 01, 2008 11:29 pm    Post subject: Reply with quote

Thanks Kolusu. We got another issue, please guide me your easiest approch. since, two days i tried but couldnt achive.

In the Input file, we are receiving blank column. That mean, the entire column of A-FIELD-8 or A-FIELD-10 are receiving spaces. In this scenario, how do we handle it? and the alignment also changing, ie.,all the zeros s are suppressed in the field-2,5,7, and 9.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group