LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 4 Jun 2004 05:28:33 -0400
Reply-To:     Peter Crawford <peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter Crawford <peter@CRAWFORDSOFTWARE.DEMON.CO.UK>
Subject:      Re: Question about sorting and copying
Comments: To: ellie.odonnell.iei8@STATEFARM.COM

On Thu, 3 Jun 2004 17:38:37 -0700, Ellie O'Donnell <ellie.odonnell.iei8@STATEFARM.COM> wrote:

>Hi, > >I am trying to copy a file and change the value of one of the fields >at the same time. The file is too big for me to edit it using the text >editor (because there is not enough room in memory (TSO.) I was going >to use SAS, but the file is 325 bytes long and has over 100 fields. I >thought maybe there was a quick way to do it using Syncsort, but am >having trouble getting the syntax right in my JCL and the manual isn't >helping and I can't find an example to model off. Does anyone have any >ideas? I simply want to copy the entire file and change the field that >begins in position 64 and goes for 8 characters to the new value of >'20060715'. > >Here is my current syntax which is wrong: > >//STEP06 EXEC SORTD >//SORTIN DD DSN=ELLIE.TEST,DISP=SHR >//SORTOUT DD DSN=ELLIE.TEST.JUL1506, >// DISP=(NEW,CATLG,DELETE), >//* DISP=(SHR,KEEP,KEEP) >// DCB=(RECFM=FB,LRECL=325,BLKSIZE=0,DSORG=PS), >// SPACE=(CYL,(100,100),RLSE),LABEL=RETPD=300, >// UNIT=DISK >//SYSIN DD * > SORT FIELDS=COPY > OUTREC FIELDS=(01:63, > 64:C'20060715', > 72:254) > END > %ENDJOB > >Thanks! >Ellie

Hi Ellie you've had two good responses Jack Hamilton addresses the underlying requirement.. simple solution Paul Dorfman adresses the problem making your solution work/fail Maybe you've only bumped into the effect of RETPD=300 Given that in your jcl, you can't replace the file for 300 days. - not even if your SORTD parameters cause it to stop early.

May I combine the messages from Jack and Paul - new jcl, new program: If the there is no reason to use sas apart from this, don't be accused of using a sledge hammer(sas) to crack a nut (rewriting data with only a small -fixed- change)

For that "nut" there is an old IBM utility, iebgener, designed for the straight forward need I perceive you have ..... ......... gener(ate) a copy with just a small change

iebgener parameter file to control the copy-with-change is just these 2 statements: GENERATE MAXFLDS=10,MAXLITS=10 RECORD FIELD=(325,,,),FIELD=(8,'20060715',,64)

That its syntax is similar to SORTD fields= parameter is a testament to the explicit simplicity of what you want

As shown by Jack's suggestion, there is little to define: the RECORD statement equates to a sas put statement the GENERATE statement indicates the type of action needed along with a couple of items which limit memory needed for the process The jcl required is as basic // EXEC PGM=IEBGENER * the program you want to run GENERATE MAXFLDS=10,MAXLITS=10 * the control file RECORD FIELD=(325,,,),FIELD=(8,'20060715',,64) //SYSUT1 DD DISP=SHR,DSN=ELLIE.TEST * input //SYSUT2 DD DISP=(,CATLG),ELLIE.TEST.JUL1506.PC, *output // DD SPACE=(CYL,(100,100),RLSE) //SYSPRINT DD SYSOUT=* * a channel for messages

When not provided, DCB= info will be copied from the input, and surely, unit=DISK is the default storage for data?

I found on-line documentation for this utility IEBGENER, at: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/DGT1U104/6.0? DT=19990113105507


Back to: Top of message | Previous page | Main SAS-L page