passing a value from file to a Symbolic



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

passing a value from file to a Symbolic

Postby mathew28 » Tue Mar 20, 2012 1:33 am

Hi,

I have an input file having some records like shown below

QC12345
12345556
14143142
23423432
24234234
24343444

I need to extract the 1st record "QC12345" and pass it to a Symbolic say Set QCNAME=QC12345
So that i can use it to name the output file DD DSN = XXXX.OUTPUT.&QCNAME., DISP=(NEW,CATLG,DELETE)

I can extract the first record using DFSORT , INREC .
But please help me with the option to pass that value to a Symbolic. Is there any way to pass a value from a file to Symbolic ? Is it possible?

Please advice. Thanks in advance.
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: passing a value from file to a Symbolic

 

Re: passing a value from file to a Symbolic

Postby Frank Yaeger » Tue Mar 20, 2012 3:16 am

I think you would have to generate a job for the internal reader. You could do that using a symbolic to generate the DSN statement or just generate the DSN statement directly from the input statement. I don't think there's any way to do what you want without seting up a job for the internal reader, but I could be wrong.
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times

Re: passing a value from file to a Symbolic

Postby Thomas Ramseier » Tue Mar 20, 2012 5:12 pm

I don't know of a way except internal reader as well - except you run a TSO-callable program like DFSORT. In this case, you could avoid the internal reader, which might help you if you run job streams thru scheduling tools (see sample below). We use this logic often to concatenate an unknown/variable number of //SORTIN -
DSNs within one job.

hth

//SETLVL SET FNAME=QC41223
//*
//STEP0000 EXEC PGM=IEFBR14  *This step is for test only - delete datasets allocated later on
//MODELDSN DD DSN=T750K.MODEL.DATA,DISP=(MOD,DELETE,DELETE),
//    UNIT=SYSDA,SPACE=(CYL,(1),RLSE),LRECL=80,RECFM=FB,BLKSIZE=0
//RERUNDSN DD DSN=T750K.TEST.QC41223.CSV.DATA,DISP=(MOD,DELETE,DELETE),
//    UNIT=SYSDA,SPACE=(CYL,(1),RLSE),LRECL=80,RECFM=FB,BLKSIZE=0
//*
//S1 EXEC PGM=SORT,PARM='JP1"&FNAME..CSV"'
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ERC.CSV
//SORTOUT DD DSN=&&NEWDSN1,DISP=(,PASS),
//    UNIT=VIO,SPACE=(1,(1),RLSE),LRECL=80,RECFM=FB
//SYSIN DD *
  INREC FINDREP=(IN=C'ERC.CSV',OUT=JP1)
  OPTION COPY
  OUTREC BUILD=(3:C'DA(''T750K.TEST.',JP1,C'.DATA'') +',
                80:X)
/*
//STEP0010 EXEC PGM=IEFBR14
//MODELDSN DD DSN=T750K.MODEL.DATA,DISP=(NEW,CATLG,DELETE),
//    UNIT=SYSDA,SPACE=(CYL,(1),RLSE),LRECL=80,RECFM=FB,BLKSIZE=0
//*
//STEP0300  EXEC PGM=IKJEFT01,DYNAMNBR=25
//SYSTSPRT  DD   SYSOUT=*
//SYSOUT    DD   SYSOUT=*
//SORTIN    DD   *
Dummy Record
//SYSIN     DD   *
    OPTION COPY
//SYSTSIN   DD   *
  ALLOC FI(SORTOUT) +
//          DD   DISP=SHR,DSN=&&NEWDSN1
//          DD   *
  NEW LIKE('T750K.MODEL.DATA')
  CALL 'SYS1.SICELINK(ICEMAN)'
/*
Thomas Ramseier
 
Posts: 16
Joined: Mon Sep 20, 2010 11:31 am
Has thanked: 0 time
Been thanked: 0 time

Re: passing a value from file to a Symbolic

Postby mathew28 » Tue Mar 20, 2012 6:59 pm

Thanks Thomas for the reply.

Hope you are combining this issue with one of my earliar queries. But this is a different issue. I don't know the value to be assigned to the Symbolic.
So, //SETLVL SET FNAME= ? is not there. The value that needs to be assigned to this Symbolic is available in the first record of my input file. I need to read it and then assign it to
the Symbolic //SETLVL SET FNAME=QC41223.
Once I get the value in the Symbolic , I can easily use it to create my output DSN.
Like
//SORTOUT DD DSN= XXXXX828.TEST.&FNAME, DISP=(NEW,CATLG,DELETE), RECFM=FB, LRECL=80.

When I tried your code, got the below Syntax error !! Is there any typo ?
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 09:19
INREC FINDREP=(IN=C'ERC.CSV',OUT=C'QC41223.CSV')
OPTION COPY
OUTREC FINDREP=(3:C'DA("XXXX828.TEST.',JP1,C'.DATA")+',80:X)
$
ICE007A 0 SYNTAX ERROR
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: passing a value from file to a Symbolic

Postby mathew28 » Tue Mar 20, 2012 7:41 pm

Hi guys.

I got a logic. Please suggest how to improve it.

1. Get the first first record from the input file and prepare the symoblic step using DFSORT INREC

INREC BUILD=(C'//SETLVL DD SET QCNAME=',1,7,80:X)

2. Create the remaining steps in a PROC. merge the file from step 1 and Proc to create a new PROC file.

3. Execute the PROC having the Symbolic to create the output file with that name.

hope it works. need to try it. Meanwhile please suggest any other ideas or improvements

Thanks in advance..
mathew28
 
Posts: 30
Joined: Tue Oct 20, 2009 11:06 am
Has thanked: 0 time
Been thanked: 0 time

Re: passing a value from file to a Symbolic

Postby BillyBoyo » Tue Mar 20, 2012 8:09 pm

Talk to your technical people about that idea first. If the PROC library is a PDS, you run a high risk of "cooking" it at some point. PDSs are not good at multiple updates.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: passing a value from file to a Symbolic

Postby Frank Yaeger » Tue Mar 20, 2012 11:17 pm

When I tried your code, got the below Syntax error !! Is there any typo ?
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R12 - 09:19
INREC FINDREP=(IN=C'ERC.CSV',OUT=C'QC41223.CSV')
OPTION COPY
OUTREC FINDREP=(3:C'DA("XXXX828.TEST.',JP1,C'.DATA")+',80:X)
$
ICE007A 0 SYNTAX ERROR


No, you did NOT try his code. His code was:

  OUTREC BUILD=(3:C'DA(''T750K.TEST.',JP1,C'.DATA'') +',   
                80:X)                                     


which is valid. The code you tried is:

  OUTREC FINDREP=(3:C'DA("XXXX828.TEST.',JP1,C'.DATA")+',80:X)   


which is very different and is not using the correct syntax for the FINDREP function. That's why you got the syntax error.
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: 1080
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 14 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post