Author Topic: Best way to load a CSV file on the host  (Read 7187 times)

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Best way to load a CSV file on the host
« on: March 24, 2016, 07:54:48 AM »
I'm trying to load a CSV file and have tried as line data,  and then tried loading with generic indexer and it is not working for me.    It actually loaded as line data....but the view in our Enhanced Seamless Search viewer is not good.  The customer wants to be able to put the data into a spreadsheet.   What is the proper  AG and APP setup to load a CSV?  Appreciate any input.  Thanks, Lori
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1200
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #1 on: March 24, 2016, 08:07:04 AM »
Here's one method:

Q1. Can you use the generic indexer ?
A1. Yes

Q2. for app def,  would data type be User Defined ?
A2. yes

Q3. and File Extension set to  csv  ?
A3. yes.  make sure you use "csv" and not ".csv"

Q4.  and once archived, if the user wants to use the archived doc for use in an xcel work sheet, do they just copy the doc to file then to the spreadsheet ?
A4. The OnDemand client will download the .csv file into its temporary work directory.  Then it will pass control to windows which will use the default program associated in windows for any .csv files.  If there is more than one program associated with .csv then you will get the windows dialog that asks which program you want to open the .csv file with.  There should not be any need to copy the file from the OnDemand client working directory manually into a program.

Ed
#zOS #ODF

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #2 on: March 24, 2016, 08:17:32 AM »
Thank you Ed!  So....if my load is failing....then my files are set up incorrectly for the GI load.  This is what I'm getting....
DSNALI OPEN call failed with CAF-RC/CAF-RE = 0000000C/00F30006 
********************************* TOP OF DATA **********************************
arsload: Using /u/arsss/tmp1 for temporary files                               
arsload: Processing file >/u/arssp/tmp1/ARSSJLFN<                               
The userexit >/u/arsss/product/bin/exits/arsuupdt< failed. The return code is 16
arsload: Processing failed for file >/u/arssp/tmp1/ARSSJLFN<                   
arsload: Processing has stopped.  The remaining files will NOT be processed.   
******************************** BOTTOM OF DATA ********************************
           
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #3 on: March 24, 2016, 08:38:11 AM »
Ed,  scratch that....I finally got it to load.  NOW my file looks like binary garbage when I view.  I've tried extension txt and extension csv.    how do I properly send the file to USS to keep the formatting correct?    We are using an ICETOOL copy - these are parameters:

//DD3      DD  PATH='/u/&ENV4/tmp1/&JNAM..ind',       
//             PATHDISP=(KEEP,DELETE),               
//             PATHOPTS=(ORDWR,OCREAT,OTRUNC),       
//             PATHMODE=(SIRWXU,SIRWXG,SIRWXO),       
//             FILEDATA=TEXT                         
//DD4      DD  PATH='/u/&ENV4/tmp1/&JNAM..out',       
//             PATHDISP=(KEEP,DELETE),               
//             PATHOPTS=(ORDWR,OCREAT,OTRUNC),       
//             PATHMODE=(SIRWXU,SIRWXG,SIRWXO),       
//             FILEDATA=TEXT                       
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #4 on: March 24, 2016, 09:52:19 AM »
should I open a pmr on this one?  I'm attaching a screenshot of the host file I'm attempting to load and then what the view looks like in the windows thick client.
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1200
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #5 on: March 24, 2016, 12:01:33 PM »
Where is the current copy of the "good" file that you can just browse?

In a regular old MVS dataset like  DD DSN=USER.DATA.LORI.CSV,DISP=SHR ?

Ed
#zOS #ODF

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #6 on: March 24, 2016, 12:19:45 PM »
yes it's in a regular old mvs dataset.  I've got to convert ebcdic to ascii don't I.   is that the step I'm missing?
Recommendation on how easiest to do that?
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1200
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #7 on: March 26, 2016, 11:00:46 AM »
yes it's in a regular old mvs dataset.  I've got to convert ebcdic to ascii don't I.   is that the step I'm missing?
Recommendation on how easiest to do that?

Could you give this a try and see if it does what you want?

//COPYSTEP EXEC PGM=IKJEFT01                             
//OUTHFS   DD PATH='/u/test99/sample3.out',             
// PATHOPTS=(OWRONLY,OCREAT,OTRUNC),                     
// PATHMODE=(SIRWXU,SIRGRP,SIXGRP,SIROTH,SIXOTH)         
//INMVS    DD DISP=SHR,DSN='TEST99.SAMPLE.OUT'           
//SYSTSPRT DD SYSOUT=*                                   
//SYSTSIN  DD *                                         
  OCOPY INDD(INMVS) OUTDD(OUTHFS) TEXT CONVERT(NO)       
/*


Ed                                                     
#zOS #ODF

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #8 on: March 28, 2016, 08:45:50 AM »
That's it!  You're a genius.  It's not loading for me yet....but the file on USS sure looks better.  Will plug away a bit more and may have another question if I can't get it to 'take'.
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #9 on: March 28, 2016, 09:37:29 AM »
Ed,  I am closer.  I had to run a convert on the host file:

CONVERT EBCDIC TO ASCII
using ‘ETOA’

And now my data loads...and looks better...but it is loading as one continuous string instead of individual
comma delimited records.  (screenshot attached)


Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1200
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #10 on: March 28, 2016, 01:43:36 PM »
Sounds like you're loading the document as just one line...with the generic indexer you have to feed CMOD the offset and length of each individual record.

For example:

GROUP_OFFSET:00000000
 GROUP_LENGTH:00002760
 GROUP_OFFSET:00002760
 GROUP_LENGTH:00002760
 GROUP_OFFSET:00005520
 GROUP_LENGTH:00002760
 GROUP_OFFSET:00008280
 GROUP_LENGTH:00002760


Instead of copying the MVS dataset with parms I suggested previously and then running a conversion see if you can just use this:

//STEP1 EXEC PGM=IKJEFT1B
 //SYSOUT   DD SYSOUT=*
 //STDOUT   DD SYSOUT=*
 //STDERR   DD SYSOUT=*
 //INMVS    DD DISP=SHR,DSN=TEST99.DATASET
 //OUTHFS   DD PATHDISP=(KEEP,KEEP),
 // PATHOPTS=(ORDWR,OCREAT),
 // PATHMODE=(SIRWXU,SIXUSR),
 // PATH='/u/test99/test99.dataset'
 //SYSPRINT DD *
 //SYSTSPRT DD DUMMY
 //SYSTSIN  DD *
 OCOPY INDD(INMVS) OUTDD(OUTHFS) BINARY
 /*


Ed


#zOS #ODF

lfbeach

  • Jr. Member
  • **
  • Posts: 43
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #11 on: March 28, 2016, 01:58:27 PM »
Ed,

You are absolutely right...that's what I'm doing.  But the customer wants to view this as a single document.
So they don't want each line loaded with different indexes, as a different entities.
Is it possible to load them as a single document?  But still have the LINES view sequentially instead of strung together?  (like so....). or am I reaching for the impossible here?

    BROWSE       TEST.ARSS.R6683.PREVAIL.RF80                  L
    Command ===>                                             
********************************* Top of Data *********
AL,   ,G ,S5498,00,00,2014-11-24,9901-01-01,000000700 
AL,001,F ,A0030,00,00,1996-01-01,2000-12-31,000200000 
AL,001,F ,A0040,00,00,1996-01-01,2000-12-31,000200000 
AL,001,F ,A0130,00,00,1999-01-01,9901-01-01,000002500 
AL,001,F ,A0300,00,00,1996-01-01,2000-12-31,000013000 
AL,001,F ,A0302,00,00,1996-01-01,2000-12-31,000013000 
AL,001,F ,A0304,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0308,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0310,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0320,00,00,1996-01-01,2000-12-31,000013000 
AL,001,F ,A0322,00,00,1996-01-01,2000-12-31,000013000 
AL,001,F ,A0324,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0326,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0328,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0330,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0342,00,00,1996-01-01,2000-12-31,000013000 
AL,001,F ,A0348,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0350,00,00,1996-01-01,2000-12-31,000026000 
AL,001,F ,A0360,00,00,1996-01-01,2000-12-31,000013000 
Lori Frazier Beach
Developer-CMOD Admin
Document Management Systems

Ed_Arnold

  • Hero Member
  • *****
  • Posts: 1200
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #12 on: March 29, 2016, 10:21:16 AM »
I'm out of bullets at this time...hoping someone else jumps in who is already doing this.

Ed
#zOS #ODF

Greg Ira

  • Full Member
  • ***
  • Posts: 240
    • View Profile
Re: Best way to load a CSV file on the host
« Reply #13 on: March 29, 2016, 11:42:23 AM »
So you aren't going through the fat client to do this?   We send a lot of items to excel but do it through the fat client which simplifies the process.

dakun

  • Guest
Re: Best way to load a CSV file on the host
« Reply #14 on: March 29, 2016, 11:49:15 AM »
did you introduce line break for each line?