Page 2 of 2

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 3:35 am
by Frank Yaeger
Dick,

I just read back through all of the posts and I think you're right. The first post does say

I have the 15000 user record's in a DATASET.


I guess all the talk about commands confused me - I thought he was asking how to change fields in an input file, not how to generate commands from an input file.

If the OP had just said in his first post:

******
I have 15000 user records in a dataset. I want to generate 15000 commands like this:

CHANGE <userid> REGION(rgn)

where userid is at positions a-b in the file and rgn is at positions c-d in the file.
******

then it all would have made sense.

jaga123,

Is that what you actually want? If so, then give the starting position, length and format of the userid and rgn fields in your input records, give the RECFM and LRECL of the input file and the output file you want to generate, and show an example of the input records and what you expect for output.

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 4:56 am
by dick scherrer
Now we wait. . . . :)

d

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 9:25 am
by jaga123
dick scherrer wrote:Hi Frank,

No, i'm guessing that there is a file that has ID, name, salary, region, and other fields with 15000 entries.

From these records, CHANGE records need to be created which will be a combination of literals and values from the file. The generated control statements would look like:
CHANGE idfromfile REGION(regnfromfile)
The CAPS are literals and the other 2 fields are from the file.

Once created, the "commands" could be issued in some batch job.

If i've understood. . . .
Hi Dick,

What you have said is correct.

Thanks

Re: JCL to update 15000 entries

PostPosted: Wed Aug 27, 2008 9:00 pm
by Frank Yaeger
jaga123,

Did you miss my post after Dick's where I said:

jaga123,

Is that what you actually want? If so, then give the starting position, length and format of the userid and rgn fields in your input records, give the RECFM and LRECL of the input file and the output file you want to generate, and show an example of the input records and what you expect for output.


Please supply the requested information.

Re: JCL to update 15000 entries

PostPosted: Thu Aug 28, 2008 9:27 am
by jaga123
jaga123,

Is that what you actually want? If so, then give the starting position, length and format of the userid and rgn fields in your input records, give the RECFM and LRECL of the input file and the output file you want to generate, and show an example of the input records and what you expect for output.

Please find the details below
RECFM=FB(both input and Output file)
LRECL=80(Both input and Output file)
User id: Starting position=8, length=12, Format=CH
Region: Starting position=61, lenght=6, Format=CH

My input record looks like
-------------------------------------
User id Name Region
-------------------------------------
TER001 Suzanne UK

Required Ouput is like

-------------------------------------
User id Name Region
-------------------------------------
TER001 Suzanne AUS

Apologies for not explaining clearly. Does it make sense now?

Thanks

Re: JCL to update 15000 entries

PostPosted: Thu Aug 28, 2008 9:02 pm
by Frank Yaeger
The input example I was asking for is the one containing the userid and region code you want to use to generate the CHANGE statements. The output example I was asking for is the expected generated CHANGE statements. I don't know if that's what you're showing me or not.

But let's assume the input file to be used to generate the CHANGE statements has the userid field as 8,12,CH and the region field as 61,6,CH. Let's further assume you want to use that input file to generate CHANGE statements like this:

CHANGE userid REGION(region)

You can use this DFSORT job:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'CHANGE ',8,12,
      C' REGION(',61,6,SQZ=(SHIFT=LEFT,LENGTH=7,TRAIL=C')'),80:X)
/*


As an example, if your input file had these records:

       USER1                                                AUS   
       USER00000002                                         ABCDEF
       U5                                                   A     


These CHANGE statements would be generated in SORTOUT:

CHANGE USER1        REGION(AUS)   
CHANGE USER00000002 REGION(ABCDEF)
CHANGE U5           REGION(A)     


Is that what you need?

Re: JCL to update 15000 entries

PostPosted: Tue Sep 16, 2008 1:27 pm
by jaga123
This is exactly what i am looking for.

Thanks a lot for your assistance.

:)