Thursday, 5 June 2014

Modify existing field using sort

To modify a field when it matches the condition given in Sort:

//SYSIN DD *
      SORT FIELDS=COPY
      OUTREC IFTHEN=(WHEN=(7,6,CH,EQ,C'MAHESH'),OVERLAY=(80:C'POLICE MAN')))
/*

the above example is to overlay a particular field in a file using condition.

Here if 7 - position 6 - length CH - character EQ - equal to C - character  (Mahesh)  then
Over write at 80 - position C - character (police man)

Eg:

Hai I Mahesh and I am from Bangalore and my occupation is
Hai l Kumar and I am from sangagiri and my occupation is

Consider the above two lines are there in the OUTREC (output file)
When you use the sort the the output will be as below

Output
Hai I Mahesh and I am from Bangalore and my occupation is Police man
Hai l Kumar and I am from sangagiri and my occupation is

Sort to pull out unpaired fields

Using sort comparing two files and pulling out the unpaired:
//SYSIN DD *
       JOINKEYS FILE=F1,FIELDS=(1,6,A)
       JOINKEYS FILE=F2,FIELDS=(1,6,A)
       JOIN UNPAIRED,F1,ONLY
       SORT FIELDS=COPY
/*
here the F1&F2 represents file one and file two these two files are compared and the un-matching fields are taken out separately.
The fields 1 - represents initial position of the key, 2 - represents length of the key and A- represents the type of character.
Unpaired keys from file one will be taken out and put into separate file.
File - F1
A00001
B00001
C00001
D00001
File - F2
A00001
C00001
Output
B00001
D00001
       

Expense Handler Application with advance technologies

Budget Planner  One of the application developed with Ionic 4 and Python-Flask.  Ionic 4 code:  https://github.com/logeshbuiltin/Expense...