Production of Comma Separated Variables



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Production of Comma Separated Variables

Postby jishnurb » Fri Aug 08, 2008 4:16 pm

Hi,
I have a Physical sequential file which contains records.
Say like this
SAM
22
PAT
like this, I would like to write them in to a file in Comma seperated format.
Thanks
jishnurb
jishnurb
 
Posts: 4
Joined: Fri Aug 08, 2008 4:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Production of Comma Separated Variables

Postby Frank Yaeger » Fri Aug 08, 2008 8:31 pm

It's not clear what you want to do here. Do you want to create one output record with the fields from all of the input records separated by commas? If so, what's the maximum number of input records? Or do you want to do something else?

You need to explain what you want to do more clearly. Give the "rules" for getting from input to output. Show the expected output. Give the RECFM and LRECL of the input file and the expected output file.
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: Production of Comma Separated Variables

Postby jishnurb » Tue Aug 12, 2008 11:31 am

I have an output physical sequential file of LRECL 80 and block size 800.The records are written in this file in this way

jishnurb
22
PAT

Now I a process which treats above flatfile as input file.The out file must be having the same features of input file(RECFM and LRECL). But the output file must look like this

jishnurb,
22,
PAT

They are comma separated.
jishnurb
 
Posts: 4
Joined: Fri Aug 08, 2008 4:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Production of Comma Separated Variables

Postby jishnurb » Tue Aug 12, 2008 11:37 am

there is no restriction to the maximum number of input records
jishnurb
 
Posts: 4
Joined: Fri Aug 08, 2008 4:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Production of Comma Separated Variables

Postby Frank Yaeger » Tue Aug 12, 2008 9:32 pm

Here's a DFSORT job that will do what you asked for:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/80)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYM DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=T1,OVERLAY=(81:SEQNUM,8,ZD)
  OUTFIL FNAMES=SYM,REMOVECC,NODETAIL,
    TRAILER1=('LASTREC,+',COUNT=(M11,LENGTH=8))
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=&&T1,DISP=(OLD,PASS)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC IFOUTLEN=80,
    IFTHEN=(WHEN=(81,8,ZD,NE,LASTREC),
      OVERLAY=(1:1,80,JFY=(SHIFT=LEFT,TRAIL=C',')))
/*
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post