query on OUTREC statement !



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

query on OUTREC statement !

Postby maandi » Wed Dec 22, 2010 9:14 pm

I had a requirement in which I need to pass a parm through the dataset (because it'll vary on each run) and replace some field in my input with these parms based on some condition. Somehow I got the idea because of reference jcl posted in the following IBM Mainframe forum link:

http://ibmmainframes.com/about6082.html

I used the following JCL :

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file1
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
* Create a DFSORT symbol as follows:
* TARG,C'abcd'
* where abcd is the value in positions 1-4
  OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD DSN=...  input file2
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Use the TARG symbol created in S1 to do the overlay.
  INREC IFTHEN=(WHEN=(1,4,CH,EQ,C'1234'),OVERLAY=(1:TARG))
/*


In this overall I understand that input is put into a variable named "TARG" and used in the S2 to pass in the OVERLAY statement present in sysin.But i could understand how the following outrec statement in S1 works:

OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)


When i saw the output of step S1 it was like : TARG,C'abcd'.

Please explain this if possible !

I would like to thank Frank Yaeger for posting this reference JCL in this forum.


Thanks with Regards,
Maandi.
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: query on OUTREC statement !

Postby maandi » Wed Dec 22, 2010 9:16 pm

Sorry for the mistake in the post

But i couldn't understand how the following outrec statement in S1 works: :)
maandi
 
Posts: 20
Joined: Sat Oct 30, 2010 1:37 am
Has thanked: 0 time
Been thanked: 0 time

Re: query on OUTREC statement !

Postby MrSpock » Wed Dec 22, 2010 10:47 pm

If you're picking up the first four positions on the SORTIN datatset in step S1 to assign to the symbolic TARG, what does YOUR input dataset look like?
User avatar
MrSpock
Global moderator
 
Posts: 807
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: query on OUTREC statement !

Postby Frank Yaeger » Wed Dec 22, 2010 11:07 pm

* Create a DFSORT symbol as follows:
* TARG,C'abcd'
* where abcd is the value in positions 1-4
  OUTREC FIELDS=(C'TARG,C''',1,4,C'''',80:X)


I'm not sure what you didn't understand.

C'TARG,C''' writes

TARG,C'

in the output record. It's C'TARG,Cx' but since x is an apostrophe, you need two apostrophes, so it's C'TARG,C'''.

1,4 writes input positions 1-4 in the output record (e.g. abcd).

C'''' writes an apostrophe in the output record. It's C'x' but since x is an apostrophe, you need two apostrophes, so it's C''''.

So the OUTREC statement gives us this output record for SYMNAMES:

TARG,C'abcd'

This is a valid DFSORT Symbol.
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