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

formatting datas


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunojsm
Warnings : 1

New User


Joined: 21 Jun 2004
Posts: 33
Location: Andorra

PostPosted: Tue Mar 07, 2006 6:49 pm
Reply with quote

hi all,

I have one scenario that in one member of a dataset i have many datas in straight forward manner like below

"123mikkiengineer12000"

in this first 3 is no,next 4 is name,next is desig and last 5 is salary.
likewise i have arnd 10 datas.

i want a jcl code such that after sub my job the output dataset should be like below

123 mikki engineer 12000

also for every field i want titles like NO NAME DESIG SAL

hope i will get the reply soon.

regs
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Tue Mar 07, 2006 7:36 pm
Reply with quote

Hi Sunojsm,
I hope this might help you.
Correct me if I am wrong.
Code:

//Step10   EXEC PGM=ICETOOL,
//            COND=(0,NE)
//*
//INPUT1       DD  DSN=Infile,
//            DISP=SHR
//*
//OUT1         DD  DSN=outfile1
//*
//DFSMSG       DD  SYSOUT=*
//TOOLMSG      DD  SYSOUT=*
//*
//TOOLIN       DD  * *** CONSTANT CONTROL CARDS ***
  COPY FROM(INPUT1) TO(OUT1) USING(CTL1)
/*    END OF INPUT
//*
//CTL1CNTL     DD  * *** CONSTANT CONTROL CARDS ***
  SORT FIELDS=COPY
  OUTREC FIELDS=(1:1,3,C' ',                NO
                 5:4,5,C',',                           NAME
                 11:9,8,C',',                          DESIG
                20:17,4,C',',                         SAL
                )
//* END OF INPUT



I hope I am right.
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Tue Mar 07, 2006 8:01 pm
Reply with quote

Hey,

A small correction in the reply that I had sent.
I have put comma instead of spaces by mistake.
Please correct that.

Here's a updated one.
Code:

//Step10   EXEC PGM=ICETOOL,
//            COND=(0,NE)
//*
//INPUT1       DD  DSN=Infile,
//            DISP=SHR
//*
//OUT1         DD  DSN=outfile1
//*
//DFSMSG       DD  SYSOUT=*
//TOOLMSG      DD  SYSOUT=*
//*
//TOOLIN       DD  * *** CONSTANT CONTROL CARDS ***
  COPY FROM(INPUT1) TO(OUT1) USING(CTL1)
/*    END OF INPUT
//*
//CTL1CNTL     DD  * *** CONSTANT CONTROL CARDS ***
  SORT FIELDS=COPY
  OUTREC FIELDS=(1:1,3,C' ',         NO
                             5:4,5,C' ',         NAME
                             11:9,8,C' ',       DESIG
                             20:17,4,C' ',     SAL
                            )
//* END OF INPUT


Please correct me if I am wrong.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 07, 2006 9:50 pm
Reply with quote

sunojsm,

It's difficult to know what your data actually looks like since you only showed one record. Assuming that the quotes are actually in the record and you have four fields of 3 bytes, 5 bytes, 8 bytes and 5 bytes, you can use a DFSORT job like the following to do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
"123mikkiengineer12000"
"467john research05521"
//SORTOUT DD SYSOUT=*
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER2=('NO',5:'NAME',11:'DESIG',20:'SAL'),
    OUTREC=(2,3,5:5,5,11:10,8,20:18,5)
/*


SORTOUT would have:

Code:

NO  NAME  DESIG    SAL   
123 mikki engineer 12000 
467 john  research 05521 


If you need more specific help, please show examples of more input records and output records and explain what you want more clearly.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 07, 2006 9:54 pm
Reply with quote

Mane,

You show:

Code:

  OUTREC FIELDS=(1:1,3,C' ',         NO
                             5:4,5,C' ',         NAME
                             11:9,8,C' ',       DESIG
                             20:17,4,C' ',     SAL


You don't need the C' ' (blank) after each field. When you specify a column (e.g. 5icon_smile.gif after a field, DFSORT fills in blanks from the end of the last field up to but not including the column. 1:1,3,5: will put a blank in column 4, so you don't need the C' ' before 5:.

Also, the poster asked for headings NO, NAME, DESIG and SAL. You've put these in as remarks in the OUTREC statement. Remarks are recognized, but otherwise ignored. For headings, you need to use HEADERx. See my job above.
Back to top
View user's profile Send private message
sunojsm
Warnings : 1

New User


Joined: 21 Jun 2004
Posts: 33
Location: Andorra

PostPosted: Wed Mar 08, 2006 9:19 am
Reply with quote

hi,

thank u very much for ur reply but the thing is that is the following r very much necessary for executing as such,also pl explain wht it indicates.

" //DFSMSG DD SYSOUT=* "

" //TOOLMSG DD SYSOUT=* "

" TOOLIN DD *
COPY FROM(INPUT1) TO(OUT1) USING(CTL1) "


" //CTL1CNTL DD * "



regs
Back to top
View user's profile Send private message
Mane Sagar

New User


Joined: 12 Jul 2005
Posts: 41
Location: mumbai

PostPosted: Wed Mar 08, 2006 6:08 pm
Reply with quote

Hi Frank,

Thanks for correcting me.

Sunojsm,

" TOOLIN DD *
COPY FROM(INPUT1) TO(OUT1) USING(CTL1) "

" //CTL1CNTL DD * "

Tells that Copy from the input file INPUT1 to outfile OUT1 as mentioned in the DD statement using the Control statement CTL1. CTL1 will contains the conditions for copy.

Correct me if I am wrong.


Thanks,
Sagar
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 08, 2006 10:09 pm
Reply with quote

Suno,

The control statements you show are for DFSORT's ICETOOL. You don't need to use ICETOOL to do what you want. The DFSORT job I showed you will do it. But if you want to use ICETOOL for some reason, the equivalent DFSORT/ICETOOL job would be:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG  DD  SYSOUT=*
//DFSMSG DD SYSOUT=*
//INPUT1 DD *
"123mikkiengineer12000"
"467john research05521"
//OUTPUT1 DD SYSOUT=*
//TOOLIN  DD    *
COPY FROM(INPUT1) USING(CTL1)
//CTL1CNTL DD *
  OUTFIL FNAMES=OUTPUT1,REMOVECC,
    HEADER2=('NO',5:'NAME',11:'DESIG',20:'SAL'),
    OUTREC=(2,3,5:5,5,11:10,8,20:18,5)
/*


Since you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Rexx formatting CLIST & REXX 2
No new posts COBOL VS SORT Utility for file format... COBOL Programming 7
No new posts Need assistance formatting when joini... SYNCSORT 8
No new posts Formatting bit fields DFSORT/ICETOOL 9
Search our Forums:

Back to Top