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
 

 

formatting datas

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: formatting datas
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    Post subject:
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    Post subject: Re: formatting datas
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 Moderator


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

PostPosted: Tue Mar 07, 2006 9:50 pm    Post subject:
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 Moderator


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

PostPosted: Tue Mar 07, 2006 9:54 pm    Post subject:
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    Post subject: Re: formatting datas
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    Post subject: Re: formatting datas
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 Moderator


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

PostPosted: Wed Mar 08, 2006 10:09 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Formatting data from Excel to mainframe kishpra JCL & VSAM 5 Fri Feb 19, 2016 7:12 pm
No new posts Formatting date in DB2 manugeorge2004 DB2 4 Thu Dec 03, 2015 3:18 am
No new posts Formatting a output to required form ... LOKESH DAIVAM All Other Mainframe Topics 2 Thu Aug 13, 2015 12:14 pm
No new posts Formatting Names Upper to Lower Exclu... shajeeth DFSORT/ICETOOL 13 Wed Dec 10, 2014 10:17 pm
No new posts Formatting CSV to Pipe..... chaky DFSORT/ICETOOL 7 Tue Dec 02, 2014 1:07 am


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